fidl_data_zx/
rights.rs

1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// DO NOT EDIT.
6// Generated from FIDL library `zx` by zither, a Fuchsia platform tool.
7
8#![allow(unused_imports)]
9
10use bitflags::bitflags;
11use zerocopy::{FromBytes, IntoBytes};
12
13#[repr(C)]
14#[derive(IntoBytes, FromBytes, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
15pub struct Rights(u32);
16
17bitflags::bitflags! {
18    impl Rights : u32 {
19        const DUPLICATE = 1 << 0;
20        const TRANSFER = 1 << 1;
21        const READ = 1 << 2;
22        const WRITE = 1 << 3;
23        const EXECUTE = 1 << 4;
24        const MAP = 1 << 5;
25        const GET_PROPERTY = 1 << 6;
26        const SET_PROPERTY = 1 << 7;
27        const ENUMERATE = 1 << 8;
28        const DESTROY = 1 << 9;
29        const SET_POLICY = 1 << 10;
30        const GET_POLICY = 1 << 11;
31        const SIGNAL = 1 << 12;
32        const SIGNAL_PEER = 1 << 13;
33        const WAIT = 1 << 14;
34        const INSPECT = 1 << 15;
35        const MANAGE_JOB = 1 << 16;
36        const MANAGE_PROCESS = 1 << 17;
37        const MANAGE_THREAD = 1 << 18;
38        const APPLY_PROFILE = 1 << 19;
39        const MANAGE_SOCKET = 1 << 20;
40        const OP_CHILDREN = 1 << 21;
41        const RESIZE = 1 << 22;
42        const ATTACH_VMO = 1 << 23;
43        const MANAGE_VMO = 1 << 24;
44        const SAME_RIGHTS = 1 << 31;
45  }
46}
47
48pub const RIGHTS_BASIC: Rights = Rights::from_bits_truncate(0b1100000000000011); // Rights.TRANSFER | Rights.DUPLICATE | Rights.WAIT | Rights.INSPECT
49
50pub const RIGHTS_IO: Rights = Rights::from_bits_truncate(0b1100); // Rights.READ | Rights.WRITE
51
52pub const RIGHTS_PROPERTY: Rights = Rights::from_bits_truncate(0b11000000); // Rights.GET_PROPERTY | Rights.SET_PROPERTY
53
54pub const RIGHTS_POLICY: Rights = Rights::from_bits_truncate(0b110000000000); // Rights.GET_POLICY | Rights.SET_POLICY
55
56pub const DEFAULT_CHANNEL_RIGHTS: Rights = Rights::from_bits_truncate(0b1111000000001110); // Rights.TRANSFER | Rights.WAIT | Rights.INSPECT | RIGHTS_IO | Rights.SIGNAL | Rights.SIGNAL_PEER
57
58pub const DEFAULT_EVENT_RIGHTS: Rights = Rights::from_bits_truncate(0b1101000000000011); // RIGHTS_BASIC | Rights.SIGNAL