[−]Struct cloudabi::rights
File descriptor rights, determining which actions may be performed.
Methods
impl rights
pub const FD_DATASYNC: rights
The right to invoke fd_datasync()
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with DSYNC
.
pub const FD_READ: rights
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()
.
pub const FD_SEEK: rights
pub const FD_STAT_PUT_FLAGS: rights
The right to invoke fd_stat_put()
with
FLAGS
.
pub const FD_SYNC: rights
The right to invoke fd_sync()
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with RSYNC
and
DSYNC
.
pub const FD_TELL: rights
The right to invoke fd_seek()
in such a way that the
file offset remains unaltered (i.e., CUR
with
offset zero).
pub const FD_WRITE: rights
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()
.
pub const FILE_ADVISE: rights
The right to invoke file_advise()
.
pub const FILE_ALLOCATE: rights
The right to invoke file_allocate()
.
pub const FILE_CREATE_DIRECTORY: rights
The right to invoke file_create()
with
DIRECTORY
.
pub const FILE_CREATE_FILE: rights
If FILE_OPEN
is set, the right to invoke
file_open()
with CREAT
.
pub const FILE_LINK_SOURCE: rights
The right to invoke file_link()
with the file
descriptor as the source directory.
pub const FILE_LINK_TARGET: rights
The right to invoke file_link()
with the file
descriptor as the target directory.
pub const FILE_OPEN: rights
The right to invoke file_open()
.
pub const FILE_READDIR: rights
The right to invoke file_readdir()
.
pub const FILE_READLINK: rights
The right to invoke file_readlink()
.
pub const FILE_RENAME_SOURCE: rights
The right to invoke file_rename()
with the file
descriptor as the source directory.
pub const FILE_RENAME_TARGET: rights
The right to invoke file_rename()
with the file
descriptor as the target directory.
pub const FILE_STAT_FGET: rights
The right to invoke file_stat_fget()
.
pub const FILE_STAT_FPUT_SIZE: rights
The right to invoke file_stat_fput()
with
SIZE
.
If FILE_OPEN
is set, includes the right to
invoke file_open()
with TRUNC
.
pub const FILE_STAT_FPUT_TIMES: rights
The right to invoke file_stat_fput()
with
ATIM
, ATIM_NOW
, MTIM
,
and MTIM_NOW
.
pub const FILE_STAT_GET: rights
The right to invoke file_stat_get()
.
pub const FILE_STAT_PUT_TIMES: rights
The right to invoke file_stat_put()
with
ATIM
, ATIM_NOW
, MTIM
,
and MTIM_NOW
.
pub const FILE_SYMLINK: rights
The right to invoke file_symlink()
.
pub const FILE_UNLINK: rights
The right to invoke file_unlink()
.
pub const MEM_MAP: rights
pub const MEM_MAP_EXEC: rights
pub const POLL_FD_READWRITE: rights
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
.
pub const POLL_PROC_TERMINATE: rights
The right to invoke poll()
to subscribe to
PROC_TERMINATE
.
pub const PROC_EXEC: rights
The right to invoke proc_exec()
.
pub const SOCK_SHUTDOWN: rights
The right to invoke sock_shutdown()
.
pub const fn empty() -> rights
Returns an empty set of flags
pub const fn all() -> rights
Returns the set containing all flags.
pub const fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<rights>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u64) -> rights
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u64) -> rights
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub const fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub const fn intersects(&self, other: rights) -> bool
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: rights) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: rights)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: rights)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: rights)
Toggles the specified flags in-place.
pub fn set(&mut self, other: rights, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Binary for rights
impl BitAnd<rights> 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<rights> for rights
fn bitand_assign(&mut self, other: rights)
Disables all flags disabled in the set.
impl BitOr<rights> 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<rights> for rights
fn bitor_assign(&mut self, other: rights)
Adds the set of flags.
impl BitXor<rights> 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<rights> for rights
fn bitxor_assign(&mut self, other: rights)
Toggles the set of flags.
impl Clone for rights
fn clone(&self) -> rights
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for rights
impl Debug for rights
impl Eq for rights
impl Extend<rights> for rights
fn extend<T: IntoIterator<Item = rights>>(&mut self, iterator: T)
impl FromIterator<rights> for rights
fn from_iter<T: IntoIterator<Item = rights>>(iterator: T) -> rights
impl Hash for rights
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl LowerHex for rights
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 Octal for rights
impl Ord for rights
fn cmp(&self, other: &rights) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<rights> for rights
impl PartialOrd<rights> for rights
fn partial_cmp(&self, other: &rights) -> Option<Ordering>
fn lt(&self, other: &rights) -> bool
fn le(&self, other: &rights) -> bool
fn gt(&self, other: &rights) -> bool
fn ge(&self, other: &rights) -> bool
impl StructuralEq for rights
impl StructuralPartialEq for rights
impl Sub<rights> 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<rights> for rights
fn sub_assign(&mut self, other: rights)
Disables all flags enabled in the set.
impl UpperHex for rights
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,