pub struct File { /* private fields */ }Expand description
One owned file descriptor, including its kernel file offset and locks.
Implementations§
Source§impl File
impl File
pub fn try_read<'a>(&self, bytes: &'a mut [u8]) -> Result<&'a mut [u8], Errno>
Sourcepub fn try_read_at<'a>(
&self,
bytes: &'a mut [u8],
offset: Offset,
) -> Result<&'a mut [u8], Errno>
pub fn try_read_at<'a>( &self, bytes: &'a mut [u8], offset: Offset, ) -> Result<&'a mut [u8], Errno>
Reads one prefix without changing this file’s current position.
pub fn try_write<'a>(&self, bytes: &'a [u8]) -> Result<&'a [u8], Errno>
pub fn metadata(&self) -> Result<Metadata, Errno>
Sourcepub fn try_lock(&self) -> Result<(), Errno>
pub fn try_lock(&self) -> Result<(), Errno>
Attempts an exclusive advisory lock without waiting for its current owner.
pub fn try_sync(&self) -> Result<(), Errno>
Trait Implementations§
Source§impl AsFd for File
impl AsFd for File
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl !Send for File
impl !Sync for File
impl Forget for File
impl Freeze for File
impl RefUnwindSafe for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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