#[non_exhaustive]pub struct OpenFileDescription { /* private fields */ }Expand description
State of a file opened for reading and/or writing
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 duplicate 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§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