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_bits() -> Self
pub const fn all_bits() -> Self
Returns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::all_flags() if you only want to use flags.
Sourcepub const fn is_all_bits(&self) -> bool
pub const fn is_all_bits(&self) -> bool
Returns true if the bitmask contains all values.
This will check for bits == !0,
use .is_all_flags() if you only want to check for all flags
Sourcepub const fn is_all_flags(&self) -> bool
pub const fn is_all_flags(&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 all() -> Self
👎Deprecated: Please use the ::all_bits() constructor
pub const fn all() -> Self
Please use the ::all_bits() constructor
Returns a bitmask that contains all values.
This will include bits that do not have any flags.
Use ::all_flags() if you only want to use flags.
Sourcepub const fn is_all(&self) -> bool
👎Deprecated: Please use the .is_all_bits() method
pub const fn is_all(&self) -> bool
Please use the .is_all_bits() method
Returns true if the bitmask contains all values.
This will check for bits == !0,
use .is_all_flags() if you only want to check for all flags
Sourcepub const fn full() -> Self
👎Deprecated: Please use the ::all_flags() constructor
pub const fn full() -> Self
Please use the ::all_flags() constructor
Returns a bitmask that contains all flags.
Sourcepub const fn is_full(&self) -> bool
👎Deprecated: Please use the .is_all_flags() method
pub const fn is_full(&self) -> bool
Please use the .is_all_flags() method
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FileOpenMode
Source§impl Debug for FileOpenMode
impl Debug for FileOpenMode
impl Eq 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 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
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 ==.