pub struct FileHandle<'fs, D: BlockDevice + 'static> { /* private fields */ }Expand description
Option-driven mounted file handle.
Writable handles buffer only when they need random-write merge semantics. New files, truncating replacements, and CTZ appends can switch to the streaming CTZ writer, which programs data blocks before the exposing metadata commit. Read-only handles keep only the current offset and ask the mounted snapshot to fill caller buffers on demand.
Implementations§
Source§impl<'fs, D: BlockDevice + 'static> FileHandle<'fs, D>
impl<'fs, D: BlockDevice + 'static> FileHandle<'fs, D>
pub fn read(&mut self, out: &mut [u8]) -> Result<usize>
pub fn write(&mut self, data: &[u8]) -> Result<usize>
pub fn write_all(&mut self, data: &[u8]) -> Result<()>
pub fn seek(&mut self, pos: usize) -> Result<()>
pub fn truncate(&mut self, len: usize) -> Result<()>
pub fn flush(&mut self) -> Result<()>
pub fn sync(&mut self) -> Result<()>
pub fn close(self) -> Result<()>
Auto Trait Implementations§
impl<'fs, D> Freeze for FileHandle<'fs, D>
impl<'fs, D> !RefUnwindSafe for FileHandle<'fs, D>
impl<'fs, D> !Send for FileHandle<'fs, D>
impl<'fs, D> !Sync for FileHandle<'fs, D>
impl<'fs, D> Unpin for FileHandle<'fs, D>
impl<'fs, D> UnsafeUnpin for FileHandle<'fs, D>
impl<'fs, D> !UnwindSafe for FileHandle<'fs, D>
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