pub enum FileMode {
Read = 0,
Write = 1,
ReadWrite = 2,
}Expand description
The FileMode enum represents the access modes available when opening
a file.
This enum is used by user program to specify how a file is opened, determining which operations can be performed on the file. It defines three basic modes:
FileMode::Read: The file is opened for reading only.FileMode::Write: The file is opened for writing only.FileMode::ReadWrite: The file is opened for both reading and writing.
These modes are used to control how the file descriptor behaves when interacting with the file (e.g., reading, writing, or both).
Variants§
Read = 0
Read-only access to the file.
In this mode, the file can only be read from, and no changes can be made to the file’s contents.
Write = 1
Write-only access to the file.
In this mode, the file can only be written to, and any existing content in the file is overwritten with new data.
ReadWrite = 2
Both Read and Write access to the file.
In this mode, the file can both be read and written, and does NOT removes existing content, but can be overwritten with new data.
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 UnwindSafe for FileMode
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)