Struct rasi_syscall::FileOpenMode
source · pub struct FileOpenMode { /* private fields */ }
fs
only.Expand description
A bitmask for open file.
See open_file
for more information.
Implementations§
source§impl FileOpenMode
impl FileOpenMode
sourcepub const Append: FileOpenMode = _
pub const Append: FileOpenMode = _
Configures the option for append mode.
When set to true, this option means the file will be writable after opening and the file cursor will be moved to the end of file before every write operaiton.
sourcepub const Writable: FileOpenMode = _
pub const Writable: FileOpenMode = _
Configures the option for write mode. If the file already exists, write calls on it will overwrite the previous contents without truncating it.
sourcepub const Readable: FileOpenMode = _
pub const Readable: FileOpenMode = _
Configures the option for read mode. When set to true, this option means the file will be readable after opening.
sourcepub const Create: FileOpenMode = _
pub const Create: FileOpenMode = _
sourcepub const CreateNew: FileOpenMode = _
pub const CreateNew: FileOpenMode = _
sourcepub const Truncate: FileOpenMode = _
pub const Truncate: FileOpenMode = _
sourcepub const fn all() -> Self
pub const fn all() -> Self
Returns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::full()
if you only want to use flags.
sourcepub const fn is_all(&self) -> bool
pub const fn is_all(&self) -> bool
Returns true
if the bitmask contains all values.
This will check for bits == !0
,
use .is_full()
if you only want to check for all flags
sourcepub const fn is_full(&self) -> bool
pub const fn is_full(&self) -> bool
Returns true
if the bitmask contains all flags.
This will fail if any unused bit is set,
consider using .truncate()
first.
sourcepub const fn truncate(&self) -> Self
pub const fn truncate(&self) -> Self
Returns a bitmask that only has bits corresponding to flags
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if self
intersects with any value in other
,
or if other
does not contain any values.
This is equivalent to (self & other) != 0 || other == 0
.
Trait Implementations§
source§impl Binary for FileOpenMode
impl Binary for FileOpenMode
source§impl BitAnd for FileOpenMode
impl BitAnd for FileOpenMode
source§impl BitAndAssign for FileOpenMode
impl BitAndAssign for FileOpenMode
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&=
operation. Read moresource§impl BitOr for FileOpenMode
impl BitOr for FileOpenMode
source§impl BitOrAssign for FileOpenMode
impl BitOrAssign for FileOpenMode
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|=
operation. Read moresource§impl BitXor for FileOpenMode
impl BitXor for FileOpenMode
source§impl BitXorAssign for FileOpenMode
impl BitXorAssign for FileOpenMode
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^=
operation. Read moresource§impl Clone for FileOpenMode
impl Clone for FileOpenMode
source§fn clone(&self) -> FileOpenMode
fn clone(&self) -> FileOpenMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FileOpenMode
impl Debug for FileOpenMode
source§impl From<FileOpenMode> for u8
impl From<FileOpenMode> for u8
source§fn from(val: FileOpenMode) -> u8
fn from(val: FileOpenMode) -> u8
source§impl From<u8> for FileOpenMode
impl From<u8> for FileOpenMode
source§impl Hash for FileOpenMode
impl Hash for FileOpenMode
source§impl LowerHex for FileOpenMode
impl LowerHex for FileOpenMode
source§impl Not for FileOpenMode
impl Not for FileOpenMode
source§impl Octal for FileOpenMode
impl Octal for FileOpenMode
source§impl Ord for FileOpenMode
impl Ord for FileOpenMode
source§fn cmp(&self, other: &FileOpenMode) -> Ordering
fn cmp(&self, other: &FileOpenMode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<u8> for FileOpenMode
impl PartialEq<u8> for FileOpenMode
source§impl PartialEq for FileOpenMode
impl PartialEq for FileOpenMode
source§fn eq(&self, other: &FileOpenMode) -> bool
fn eq(&self, other: &FileOpenMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FileOpenMode
impl PartialOrd for FileOpenMode
source§fn partial_cmp(&self, other: &FileOpenMode) -> Option<Ordering>
fn partial_cmp(&self, other: &FileOpenMode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more