[]Struct cloudabi::rights

#[repr(C)]
pub struct rights { /* fields omitted */ }

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

The right to invoke fd_seek(). This flag implies FD_TELL.

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.

The right to invoke file_link() with the file descriptor as the source directory.

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().

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.

The right to invoke file_symlink().

The right to invoke file_unlink().

pub const MEM_MAP: rights

The right to invoke mem_map() with mprot set to zero.

pub const MEM_MAP_EXEC: rights

If MEM_MAP is set, the right to invoke mem_map() with EXEC.

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

impl Copy for rights

impl Debug for rights

impl Eq for rights

impl Extend<rights> for rights

impl FromIterator<rights> for rights

impl Hash for rights

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

impl PartialEq<rights> for rights

impl PartialOrd<rights> for rights

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

impl Send for rights

impl Sync for rights

impl Unpin for rights

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.