[−]Struct wasihost_core::wasi_snapshot_preview1::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 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
.
pub const PATH_LINK_SOURCE: Rights
The right to invoke path_link
with the file descriptor as the
source directory.
pub const PATH_LINK_TARGET: Rights
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
.
pub const PATH_READLINK: Rights
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
.
pub const PATH_SYMLINK: Rights
The right to invoke path_symlink
.
pub const PATH_REMOVE_DIRECTORY: Rights
The right to invoke path_remove_directory
.
pub const PATH_UNLINK_FILE: Rights
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
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
impl WasiValue for Rights
[src]
type NativeType = u64
The native WASM type.
fn from_native(native: Self::NativeType) -> Result<Self, WasiValueError<Self>>
[src]
fn to_native(self) -> Self::NativeType
[src]
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]
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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[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> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,