pub struct Open(/* private fields */);
Expand description
The type of opening a file.
The type is stored in a 8-bit integer, with the following layout:
Create | Create exclusive | Truncate | Directory |
---|---|---|---|
0 | 1 | 2 | 3 |
§Example
use file_system::Open_type;
let open = Open_type::new(true, true, false);
assert_eq!(open.get_create(), true);
assert_eq!(open.get_exclusive(), true);
assert_eq!(open.get_truncate(), false);
Implementations§
Source§impl Open
impl Open
pub const CREATE_MASK: u8 = 1u8
pub const EXCLUSIVE_MASK: u8 = 2u8
pub const TRUNCATE_MASK: u8 = 4u8
pub const SIZE: u8 = 3u8
pub const NONE: Self
pub const CREATE: Self
pub const CREATE_ONLY: Self
pub const TRUNCATE: Self
pub const fn new(create: bool, create_only: bool, truncate: bool) -> Self
pub const fn get_bit(&self, mask: u8) -> bool
pub const fn set_bit(self, mask: u8, value: bool) -> Self
pub const fn get_create(&self) -> bool
pub const fn set_create(self, value: bool) -> Self
pub const fn get_exclusive(&self) -> bool
pub const fn set_exclusive(self, value: bool) -> Self
pub const fn get_truncate(&self) -> bool
pub const fn set_truncate(self, value: bool) -> Self
pub const fn from_u8(value: u8) -> Self
Trait Implementations§
impl Copy for Open
impl Eq for Open
impl StructuralPartialEq for Open
Auto Trait Implementations§
impl Freeze for Open
impl RefUnwindSafe for Open
impl Send for Open
impl Sync for Open
impl Unpin for Open
impl UnwindSafe for Open
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