Struct cloudabi::rights
[−]
#[repr(C)]pub struct rights { /* fields omitted */ }
File descriptor rights, determining which actions may be performed.
Methods
impl rights
const FD_DATASYNC: rights
FD_DATASYNC: rights = rights{bits: 1,}
The right to invoke fd_datasync()
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with DSYNC
.
const FD_READ: rights
FD_READ: rights = rights{bits: 2,}
The right to invoke fd_read()
and sock_recv()
.
If MEM_MAP
is set, includes the right to
invoke mem_map()
with memory protection option
READ
.
If FD_SEEK
is set, includes the right to invoke
fd_pread()
.
const FD_SEEK: rights
const FD_STAT_PUT_FLAGS: rights
FD_STAT_PUT_FLAGS: rights = rights{bits: 8,}
The right to invoke fd_stat_put()
with
FLAGS
.
const FD_SYNC: rights
FD_SYNC: rights = rights{bits: 16,}
The right to invoke fd_sync()
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with RSYNC
and
DSYNC
.
const FD_TELL: rights
FD_TELL: rights = rights{bits: 32,}
The right to invoke fd_seek()
in such a way that the
file offset remains unaltered (i.e., CUR
with
offset zero).
const FD_WRITE: rights
FD_WRITE: rights = rights{bits: 64,}
The right to invoke fd_write()
and sock_send()
.
If MEM_MAP
is set, includes the right to
invoke mem_map()
with memory protection option
WRITE
.
If FD_SEEK
is set, includes the right to
invoke fd_pwrite()
.
const FILE_ADVISE: rights
FILE_ADVISE: rights = rights{bits: 128,}
The right to invoke file_advise()
.
const FILE_ALLOCATE: rights
FILE_ALLOCATE: rights = rights{bits: 256,}
The right to invoke file_allocate()
.
const FILE_CREATE_DIRECTORY: rights
FILE_CREATE_DIRECTORY: rights = rights{bits: 512,}
The right to invoke file_create()
with
DIRECTORY
.
const FILE_CREATE_FILE: rights
FILE_CREATE_FILE: rights = rights{bits: 1024,}
If FILE_OPEN
is set, the right to invoke
file_open()
with CREAT
.
const FILE_LINK_SOURCE: rights
FILE_LINK_SOURCE: rights = rights{bits: 4096,}
The right to invoke file_link()
with the file
descriptor as the source directory.
const FILE_LINK_TARGET: rights
FILE_LINK_TARGET: rights = rights{bits: 8192,}
The right to invoke file_link()
with the file
descriptor as the target directory.
const FILE_OPEN: rights
FILE_OPEN: rights = rights{bits: 16384,}
The right to invoke file_open()
.
const FILE_READDIR: rights
FILE_READDIR: rights = rights{bits: 32768,}
The right to invoke file_readdir()
.
const FILE_READLINK: rights
FILE_READLINK: rights = rights{bits: 65536,}
The right to invoke file_readlink()
.
const FILE_RENAME_SOURCE: rights
FILE_RENAME_SOURCE: rights = rights{bits: 131072,}
The right to invoke file_rename()
with the file
descriptor as the source directory.
const FILE_RENAME_TARGET: rights
FILE_RENAME_TARGET: rights = rights{bits: 262144,}
The right to invoke file_rename()
with the file
descriptor as the target directory.
const FILE_STAT_FGET: rights
FILE_STAT_FGET: rights = rights{bits: 524288,}
The right to invoke file_stat_fget()
.
const FILE_STAT_FPUT_SIZE: rights
FILE_STAT_FPUT_SIZE: rights = rights{bits: 1048576,}
The right to invoke file_stat_fput()
with
SIZE
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with TRUNC
.
const FILE_STAT_FPUT_TIMES: rights
FILE_STAT_FPUT_TIMES: rights = rights{bits: 2097152,}
The right to invoke file_stat_fput()
with
ATIM
, ATIM_NOW
, MTIM
,
and MTIM_NOW
.
const FILE_STAT_GET: rights
FILE_STAT_GET: rights = rights{bits: 4194304,}
The right to invoke file_stat_get()
.
const FILE_STAT_PUT_TIMES: rights
FILE_STAT_PUT_TIMES: rights = rights{bits: 8388608,}
The right to invoke file_stat_put()
with
ATIM
, ATIM_NOW
, MTIM
,
and MTIM_NOW
.
const FILE_SYMLINK: rights
FILE_SYMLINK: rights = rights{bits: 16777216,}
The right to invoke file_symlink()
.
const FILE_UNLINK: rights
FILE_UNLINK: rights = rights{bits: 33554432,}
The right to invoke file_unlink()
.
const MEM_MAP: rights
const MEM_MAP_EXEC: rights
MEM_MAP_EXEC: rights = rights{bits: 134217728,}
const POLL_FD_READWRITE: rights
POLL_FD_READWRITE: rights = rights{bits: 268435456,}
If FD_READ
is set, includes the right to
invoke poll()
to subscribe to FD_READ
.
If FD_WRITE
is set, includes the right to
invoke poll()
to subscribe to FD_WRITE
.
const POLL_PROC_TERMINATE: rights
POLL_PROC_TERMINATE: rights = rights{bits: 1073741824,}
The right to invoke poll()
to subscribe to
PROC_TERMINATE
.
const PROC_EXEC: rights
PROC_EXEC: rights = rights{bits: 4294967296,}
The right to invoke proc_exec()
.
const SOCK_SHUTDOWN: rights
SOCK_SHUTDOWN: rights = rights{bits: 549755813888,}
The right to invoke sock_shutdown()
.
fn empty() -> rights
Returns an empty set of flags.
fn all() -> rights
Returns the set containing all flags.
fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
fn from_bits(bits: u64) -> Option<rights>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
fn from_bits_truncate(bits: u64) -> rights
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
fn is_all(&self) -> bool
Returns true
if all flags are currently set.
fn intersects(&self, other: rights) -> bool
Returns true
if there are flags common to both self
and other
.
fn contains(&self, other: rights) -> bool
Returns true
all of the flags in other
are contained within self
.
fn insert(&mut self, other: rights)
Inserts the specified flags in-place.
fn remove(&mut self, other: rights)
Removes the specified flags in-place.
fn toggle(&mut self, other: rights)
Toggles the specified flags in-place.
fn set(&mut self, other: rights, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for rights
impl PartialEq for rights
fn eq(&self, __arg_0: &rights) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &rights) -> bool
This method tests for !=
.
impl Eq for rights
impl Clone for rights
fn clone(&self) -> rights
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd for rights
fn partial_cmp(&self, __arg_0: &rights) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &rights) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &rights) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &rights) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &rights) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for rights
fn cmp(&self, __arg_0: &rights) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for rights
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for rights
impl Binary for rights
impl Octal for rights
impl LowerHex for rights
impl UpperHex for rights
impl BitOr for rights
type Output = rights
The resulting type after applying the |
operator.
fn bitor(self, other: rights) -> rights
Returns the union of the two sets of flags.
impl BitOrAssign for rights
fn bitor_assign(&mut self, other: rights)
Adds the set of flags.
impl BitXor for rights
type Output = rights
The resulting type after applying the ^
operator.
fn bitxor(self, other: rights) -> rights
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for rights
fn bitxor_assign(&mut self, other: rights)
Toggles the set of flags.
impl BitAnd for rights
type Output = rights
The resulting type after applying the &
operator.
fn bitand(self, other: rights) -> rights
Returns the intersection between the two sets of flags.
impl BitAndAssign for rights
fn bitand_assign(&mut self, other: rights)
Disables all flags disabled in the set.
impl Sub for rights
type Output = rights
The resulting type after applying the -
operator.
fn sub(self, other: rights) -> rights
Returns the set difference of the two sets of flags.
impl SubAssign for rights
fn sub_assign(&mut self, other: rights)
Disables all flags enabled in the set.
impl Not for rights
type Output = rights
The resulting type after applying the !
operator.
fn not(self) -> rights
Returns the complement of this set of flags.
impl Extend<rights> for rights
fn extend<T: IntoIterator<Item = rights>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<rights> for rights
fn from_iter<T: IntoIterator<Item = rights>>(iterator: T) -> rights
Creates a value from an iterator. Read more