pub struct Flags_type(/* private fields */);
Expand description
All the flags that can be set for a file.
The flags are stored in a 16-bit integer, with the following layout:
Mode | Open | Status |
---|---|---|
0-1 | 2-5 | 6-9 |
§Example
use File_system::{Flags_type, Mode_type, Open_type, Status_type};
let Flags = Flags_type::New(Mode_type::Read_write, Some(Open_type::Create_only), Some(Status_type::Non_blocking));
assert_eq!(Flags.Get_mode(), Mode_type::Read_write);
assert_eq!(Flags.Get_open(), Open_type::Create_only);
assert_eq!(Flags.Get_status(), Status_type::Non_blocking);
Implementations§
Source§impl Flags_type
impl Flags_type
pub const fn New( Mode: Mode_type, Open: Option<Open_type>, Status: Option<Status_type>, ) -> Self
pub const fn Get_mode(&self) -> Mode_type
pub const fn Get_open(&self) -> Open_type
pub const fn Get_status(&self) -> Status_type
pub const fn Set_mode(self, Mode: Mode_type) -> Self
pub const fn Set_open(self, Open: Open_type) -> Self
pub const fn Set_status(self, Status: Status_type) -> Self
pub fn Is_permission_granted(&self, Permission: &Permission_type) -> bool
Trait Implementations§
Source§impl Clone for Flags_type
impl Clone for Flags_type
Source§fn clone(&self) -> Flags_type
fn clone(&self) -> Flags_type
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Flags_type
impl Debug for Flags_type
Source§impl From<Flags_type> for u16
impl From<Flags_type> for u16
Source§fn from(Flags: Flags_type) -> Self
fn from(Flags: Flags_type) -> Self
Converts to this type from the input type.
Source§impl From<Mode_type> for Flags_type
impl From<Mode_type> for Flags_type
Source§impl PartialEq for Flags_type
impl PartialEq for Flags_type
impl Copy for Flags_type
impl Eq for Flags_type
impl StructuralPartialEq for Flags_type
Auto Trait Implementations§
impl Freeze for Flags_type
impl RefUnwindSafe for Flags_type
impl Send for Flags_type
impl Sync for Flags_type
impl Unpin for Flags_type
impl UnwindSafe for Flags_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