Skip to main content

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
8use bitflags::bitflags;
9use zerocopy::{FromBytes, IntoBytes};
10
11#[repr(C)]
12#[derive(IntoBytes, FromBytes, Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
13pub struct Rights(u32);
14
15bitflags! {
16    impl Rights : u32 {
17        const DUPLICATE = 1 << 0;
18        const TRANSFER = 1 << 1;
19        const READ = 1 << 2;
20        const WRITE = 1 << 3;
21        const EXECUTE = 1 << 4;
22        const MAP = 1 << 5;
23        const GET_PROPERTY = 1 << 6;
24        const SET_PROPERTY = 1 << 7;
25        const ENUMERATE = 1 << 8;
26        const DESTROY = 1 << 9;
27        const SET_POLICY = 1 << 10;
28        const GET_POLICY = 1 << 11;
29        const SIGNAL = 1 << 12;
30        const SIGNAL_PEER = 1 << 13;
31        const WAIT = 1 << 14;
32        const INSPECT = 1 << 15;
33        const MANAGE_JOB = 1 << 16;
34        const MANAGE_PROCESS = 1 << 17;
35        const MANAGE_THREAD = 1 << 18;
36        const APPLY_PROFILE = 1 << 19;
37        const MANAGE_SOCKET = 1 << 20;
38        const OP_CHILDREN = 1 << 21;
39        const RESIZE = 1 << 22;
40        const ATTACH_VMO = 1 << 23;
41        const MANAGE_VMO = 1 << 24;
42        const SAME_RIGHTS = 1 << 31;
43  }
44}
45
46pub const RIGHTS_BASIC: Rights = Rights::from_bits_truncate(0b1100000000000011); // Rights.TRANSFER | Rights.DUPLICATE | Rights.WAIT | Rights.INSPECT
47
48pub const RIGHTS_IO: Rights = Rights::from_bits_truncate(0b1100); // Rights.READ | Rights.WRITE
49
50pub const RIGHTS_PROPERTY: Rights = Rights::from_bits_truncate(0b11000000); // Rights.GET_PROPERTY | Rights.SET_PROPERTY
51
52pub const RIGHTS_POLICY: Rights = Rights::from_bits_truncate(0b110000000000); // Rights.GET_POLICY | Rights.SET_POLICY
53
54pub const DEFAULT_CHANNEL_RIGHTS: Rights = Rights::from_bits_truncate(0b1111000000001110); // Rights.TRANSFER | Rights.WAIT | Rights.INSPECT | RIGHTS_IO | Rights.SIGNAL | Rights.SIGNAL_PEER
55
56pub const DEFAULT_EVENT_RIGHTS: Rights = Rights::from_bits_truncate(0b1101000000000011); // RIGHTS_BASIC | Rights.SIGNAL