[]Struct wasihost_core::wasi_snapshot_preview1::Rights

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 path_open is set, includes the right to invoke path_open with fdflags::dsync.

pub const FD_READ: Rights

The right to invoke fd_read and sock_recv. If rights::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 rights::fd_tell.

pub const FD_FDSTAT_SET_FLAGS: Rights

The right to invoke fd_fdstat_set_flags.

pub const FD_SYNC: Rights

The right to invoke fd_sync. If path_open is set, includes the right to invoke path_open with fdflags::rsync and fdflags::dsync.

pub const FD_TELL: Rights

The right to invoke fd_seek in such a way that the file offset remains unaltered (i.e., whence::cur with offset zero), or to invoke fd_tell.

pub const FD_WRITE: Rights

The right to invoke fd_write and sock_send. If rights::fd_seek is set, includes the right to invoke fd_pwrite.

pub const FD_ADVISE: Rights

The right to invoke fd_advise.

pub const FD_ALLOCATE: Rights

The right to invoke fd_allocate.

pub const PATH_CREATE_DIRECTORY: Rights

The right to invoke path_create_directory.

pub const PATH_CREATE_FILE: Rights

If path_open is set, the right to invoke path_open with oflags::creat.

The right to invoke path_link with the file descriptor as the source directory.

The right to invoke path_link with the file descriptor as the target directory.

pub const PATH_OPEN: Rights

The right to invoke path_open.

pub const FD_READDIR: Rights

The right to invoke fd_readdir.

The right to invoke path_readlink.

pub const PATH_RENAME_SOURCE: Rights

The right to invoke path_rename with the file descriptor as the source directory.

pub const PATH_RENAME_TARGET: Rights

The right to invoke path_rename with the file descriptor as the target directory.

pub const PATH_FILESTAT_GET: Rights

The right to invoke path_filestat_get.

pub const PATH_FILESTAT_SET_SIZE: Rights

The right to change a file's size (there is no path_filestat_set_size). If path_open is set, includes the right to invoke path_open with oflags::trunc.

pub const PATH_FILESTAT_SET_TIMES: Rights

The right to invoke path_filestat_set_times.

pub const FD_FILESTAT_GET: Rights

The right to invoke fd_filestat_get.

pub const FD_FILESTAT_SET_SIZE: Rights

The right to invoke fd_filestat_set_size.

pub const FD_FILESTAT_SET_TIMES: Rights

The right to invoke fd_filestat_set_times.

The right to invoke path_symlink.

pub const PATH_REMOVE_DIRECTORY: Rights

The right to invoke path_remove_directory.

The right to invoke path_unlink_file.

pub const POLL_FD_READWRITE: Rights

If rights::fd_read is set, includes the right to invoke poll_oneoff to subscribe to eventtype::fd_read. If rights::fd_write is set, includes the right to invoke poll_oneoff to subscribe to eventtype::fd_write.

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

impl WasiValue for Rights[src]

type NativeType = u64

The native WASM type.

Auto Trait Implementations

impl RefUnwindSafe for Rights

impl Send for Rights

impl Sync for Rights

impl Unpin for Rights

impl UnwindSafe 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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

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

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.