pub struct Open_type(/* 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_type
impl Open_type
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_type
impl Eq for Open_type
impl StructuralPartialEq for Open_type
Auto Trait Implementations§
impl Freeze for Open_type
impl RefUnwindSafe for Open_type
impl Send for Open_type
impl Sync for Open_type
impl Unpin for Open_type
impl UnwindSafe for Open_type
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