#[non_exhaustive]#[repr(u8)]pub enum FileMode {
Readonly = 0,
Writable = 1,
}Expand description
Describes a mode by which a file may be manipulated.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Readonly = 0
A file mode that can only read from files.
Writable = 1
A file mode that can read from and write to files.
Implementations§
Source§impl FileMode
impl FileMode
Sourcepub const fn can_read(self) -> bool
pub const fn can_read(self) -> bool
Returns true if this FileMode is allowed to read, false otherwise.
Sourcepub const fn can_write(self) -> bool
pub const fn can_write(self) -> bool
Returns true if this FileMode is allowed to write, false otherwise.
Sourcepub const fn must_read(self) -> Result<(), OtherError>
pub const fn must_read(self) -> Result<(), OtherError>
Throws an appropriate error if this FileMode is not allowed to read.
Sourcepub const fn must_write(self) -> Result<(), OtherError>
pub const fn must_write(self) -> Result<(), OtherError>
Throws an appropriate error if this FileMode is not allowed to write.
Trait Implementations§
Source§impl Ord for FileMode
impl Ord for FileMode
Source§impl PartialOrd for FileMode
impl PartialOrd for FileMode
impl Copy for FileMode
impl Eq for FileMode
impl StructuralPartialEq for FileMode
Auto Trait Implementations§
impl Freeze for FileMode
impl RefUnwindSafe for FileMode
impl Send for FileMode
impl Sync for FileMode
impl Unpin for FileMode
impl UnsafeUnpin for FileMode
impl UnwindSafe for FileMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.