pub struct Mode_type(/* private fields */);
Expand description
The mode of a file.
The mode is stored in a 8-bit integer, with the following layout:
Read | Write |
---|---|
0 | 1 |
§Example
use File_system::Mode_type;
let Mode = Mode_type::New(true, false);
assert_eq!(Mode.Get_read(), true);
assert_eq!(Mode.Get_write(), false);
let Mode = Mode_type::New(false, true);
assert_eq!(Mode.Get_read(), false);
assert_eq!(Mode.Get_write(), true);
let Mode = Mode_type::New(true, true);
assert_eq!(Mode.Get_read(), true);
assert_eq!(Mode.Get_write(), true);
Implementations§
Source§impl Mode_type
impl Mode_type
pub const Read_bit: u8 = 1u8
pub const Write_bit: u8 = 2u8
pub const Size: u8 = 2u8
pub const Read_only: Self = _
pub const Write_only: Self = _
pub const Read_write: Self = _
pub const fn New(Read: bool, Write: bool) -> Self
pub const fn Set_bit(self, Mask: u8, Value: bool) -> Self
pub const fn Set_read(self, Value: bool) -> Self
pub const fn Set_write(self, Value: bool) -> Self
pub const fn Get_bit(&self, Mask: u8) -> bool
pub const fn Get_read(&self) -> bool
pub const fn Get_write(&self) -> bool
pub const fn From_u8(Value: u8) -> Self
pub const fn As_u8(&self) -> u8
Trait Implementations§
Source§impl From<Mode_type> for Flags_type
impl From<Mode_type> for Flags_type
impl Copy for Mode_type
impl Eq for Mode_type
impl StructuralPartialEq for Mode_type
Auto Trait Implementations§
impl Freeze for Mode_type
impl RefUnwindSafe for Mode_type
impl Send for Mode_type
impl Sync for Mode_type
impl Unpin for Mode_type
impl UnwindSafe for Mode_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