pub struct FileOpenMode { /* private fields */ }fs or docsrs only.Expand description
A bitmask for open file.
See open_file for more information.
Implementations§
Source§impl FileOpenMode
impl FileOpenMode
Sourcepub const Append: FileOpenMode
Available on crate feature fs only.
pub const Append: FileOpenMode
fs only.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
Available on crate feature fs only.
pub const Writable: FileOpenMode
fs only.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
Available on crate feature fs only.
pub const Readable: FileOpenMode
fs only.Configures the option for read mode. When set to true, this option means the file will be readable after opening.
Sourcepub const Create: FileOpenMode
Available on crate feature fs only.
pub const Create: FileOpenMode
fs only.Sourcepub const CreateNew: FileOpenMode
Available on crate feature fs only.
pub const CreateNew: FileOpenMode
fs only.Sourcepub const Truncate: FileOpenMode
Available on crate feature fs only.
pub const Truncate: FileOpenMode
fs only.Sourcepub const fn bits(&self) -> u8
Available on crate feature fs only.
pub const fn bits(&self) -> u8
fs only.Returns the underlying bits of the bitmask.
Sourcepub const fn all_bits() -> Self
Available on crate feature fs only.
pub const fn all_bits() -> Self
fs only.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 all_flags() -> Self
Available on crate feature fs only.
pub const fn all_flags() -> Self
fs only.Returns a bitmask that contains all flags.
Sourcepub const fn is_all_bits(&self) -> bool
Available on crate feature fs only.
pub const fn is_all_bits(&self) -> bool
fs only.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
Available on crate feature fs only.
pub const fn is_all_flags(&self) -> bool
fs only.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() constructorAvailable on crate feature fs only.
pub const fn all() -> Self
::all_bits() constructorfs only.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() methodAvailable on crate feature fs only.
pub const fn is_all(&self) -> bool
.is_all_bits() methodfs only.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() constructorAvailable on crate feature fs only.
pub const fn full() -> Self
::all_flags() constructorfs only.Returns a bitmask that contains all flags.
Sourcepub const fn is_full(&self) -> bool
👎Deprecated: Please use the .is_all_flags() methodAvailable on crate feature fs only.
pub const fn is_full(&self) -> bool
.is_all_flags() methodfs only.Returns true if the bitmask contains all flags.
This will fail if any unused bit is set,
consider using .truncate() first.
Sourcepub const fn none() -> Self
Available on crate feature fs only.
pub const fn none() -> Self
fs only.Returns a bitmask that does not contain any values.
Sourcepub const fn is_none(&self) -> bool
Available on crate feature fs only.
pub const fn is_none(&self) -> bool
fs only.Returns true if the bitmask does not contain any values.
Sourcepub const fn truncate(&self) -> Self
Available on crate feature fs only.
pub const fn truncate(&self) -> Self
fs only.Returns a bitmask that only has bits corresponding to flags
Sourcepub const fn intersects(&self, other: Self) -> bool
Available on crate feature fs only.
pub const fn intersects(&self, other: Self) -> bool
fs only.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.
Sourcepub const fn contains(&self, other: Self) -> bool
Available on crate feature fs only.
pub const fn contains(&self, other: Self) -> bool
fs only.Returns true if self contains all values of other.
This is equivalent to (self & other) == other.
Sourcepub const fn not(self) -> Self
Available on crate feature fs only.
pub const fn not(self) -> Self
fs only.Returns the bitwise NOT of the bitmask.
Sourcepub const fn and(self, other: Self) -> Self
Available on crate feature fs only.
pub const fn and(self, other: Self) -> Self
fs only.Returns the bitwise AND of the bitmask.
Trait Implementations§
Source§impl Binary for FileOpenMode
Available on crate feature fs only.
impl Binary for FileOpenMode
fs only.Source§impl BitAnd for FileOpenMode
Available on crate feature fs only.
impl BitAnd for FileOpenMode
fs only.Source§impl BitAndAssign for FileOpenMode
Available on crate feature fs only.
impl BitAndAssign for FileOpenMode
fs only.Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for FileOpenMode
Available on crate feature fs only.
impl BitOr for FileOpenMode
fs only.Source§impl BitOrAssign for FileOpenMode
Available on crate feature fs only.
impl BitOrAssign for FileOpenMode
fs only.Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for FileOpenMode
Available on crate feature fs only.
impl BitXor for FileOpenMode
fs only.Source§impl BitXorAssign for FileOpenMode
Available on crate feature fs only.
impl BitXorAssign for FileOpenMode
fs only.Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for FileOpenMode
Available on crate feature fs only.
impl Clone for FileOpenMode
fs only.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
Available on crate feature fs only.
impl Debug for FileOpenMode
fs only.Source§impl From<FileOpenMode> for u8
Available on crate feature fs only.
impl From<FileOpenMode> for u8
fs only.Source§fn from(val: FileOpenMode) -> u8
fn from(val: FileOpenMode) -> u8
Source§impl From<u8> for FileOpenMode
Available on crate feature fs only.
impl From<u8> for FileOpenMode
fs only.Source§impl Hash for FileOpenMode
Available on crate feature fs only.
impl Hash for FileOpenMode
fs only.Source§impl LowerHex for FileOpenMode
Available on crate feature fs only.
impl LowerHex for FileOpenMode
fs only.Source§impl Not for FileOpenMode
Available on crate feature fs only.
impl Not for FileOpenMode
fs only.Source§impl Octal for FileOpenMode
Available on crate feature fs only.
impl Octal for FileOpenMode
fs only.Source§impl Ord for FileOpenMode
Available on crate feature fs only.
impl Ord for FileOpenMode
fs only.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
Available on crate feature fs only.
impl PartialEq<u8> for FileOpenMode
fs only.Source§impl PartialEq for FileOpenMode
Available on crate feature fs only.
impl PartialEq for FileOpenMode
fs only.Source§impl PartialOrd for FileOpenMode
Available on crate feature fs only.
impl PartialOrd for FileOpenMode
fs only.Source§impl UpperHex for FileOpenMode
Available on crate feature fs only.
impl UpperHex for FileOpenMode
fs only.impl Copy for FileOpenMode
fs only.impl Eq for FileOpenMode
fs only.impl StructuralPartialEq for FileOpenMode
fs only.