Struct yash_env::system::virtual::OpenFileDescription
source · pub struct OpenFileDescription {
pub file: Rc<RefCell<INode>>,
pub offset: usize,
pub is_readable: bool,
pub is_writable: bool,
pub is_appending: bool,
}Expand description
State of a file opened for reading and/or writing.
Fields§
§file: Rc<RefCell<INode>>The file.
offset: usizePosition in bytes to perform next I/O operation at.
is_readable: boolWhether this file is opened for reading.
is_writable: boolWhether this file is opened for writing.
is_appending: boolWhether this file is opened for appending.
Implementations§
source§impl OpenFileDescription
impl OpenFileDescription
sourcepub fn is_readable(&self) -> bool
pub fn is_readable(&self) -> bool
Returns true if you can read from this open file description.
sourcepub fn is_writable(&self) -> bool
pub fn is_writable(&self) -> bool
Returns true if you can write to this open file description.
sourcepub fn is_ready_for_reading(&self) -> bool
pub fn is_ready_for_reading(&self) -> bool
Returns true if you can read from this open file description without blocking.
sourcepub fn is_ready_for_writing(&self) -> bool
pub fn is_ready_for_writing(&self) -> bool
Returns true if you can write to this open file description without blocking.
sourcepub fn read(&mut self, buffer: &mut [u8]) -> Result<usize, Errno>
pub fn read(&mut self, buffer: &mut [u8]) -> Result<usize, Errno>
Reads from this open file description.
Returns the number of bytes successfully read.
sourcepub fn write(&mut self, buffer: &[u8]) -> Result<usize, Errno>
pub fn write(&mut self, buffer: &[u8]) -> Result<usize, Errno>
Writes to this open file description.
Returns the number of bytes successfully written.
Trait Implementations§
source§impl Clone for OpenFileDescription
impl Clone for OpenFileDescription
source§fn clone(&self) -> OpenFileDescription
fn clone(&self) -> OpenFileDescription
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 OpenFileDescription
impl Debug for OpenFileDescription
Auto Trait Implementations§
impl Freeze for OpenFileDescription
impl !RefUnwindSafe for OpenFileDescription
impl !Send for OpenFileDescription
impl !Sync for OpenFileDescription
impl Unpin for OpenFileDescription
impl !UnwindSafe for OpenFileDescription
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more