pub struct File { /* private fields */ }
Expand description
File Interface
Implementations§
source§impl File
impl File
sourcepub fn write_all(&mut self, data: &[u8]) -> CNFSResult
pub fn write_all(&mut self, data: &[u8]) -> CNFSResult
Attempts to write an entire buffer into a file.
sourcepub fn write(&mut self, src: &[u8]) -> CNFSResult<usize>
pub fn write(&mut self, src: &[u8]) -> CNFSResult<usize>
Write a buffer into a file, returning how many bytes were written.
sourcepub fn read(&mut self, dest: &mut [u8]) -> CNFSResult<usize>
pub fn read(&mut self, dest: &mut [u8]) -> CNFSResult<usize>
Pull some bytes from this file into the specified buffer, returning how many bytes were read.
sourcepub fn read_to_end(&mut self, dest: &mut Vec<u8>) -> CNFSResult
pub fn read_to_end(&mut self, dest: &mut Vec<u8>) -> CNFSResult
Read all bytes until EOF in this source, placing them into dest
.
sourcepub fn seek(&mut self, new_offset: u64) -> CNFSResult
pub fn seek(&mut self, new_offset: u64) -> CNFSResult
Seek to an offset
sourcepub fn sync(&mut self) -> CNFSResult
pub fn sync(&mut self) -> CNFSResult
Synchronize the data to filesystem.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for File
impl !RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin 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