pub struct BufferedFile { /* private fields */ }Expand description
File convenience wrapper. Reads only the requested range, without prefetch or a retained cache; writes are durable before returning successfully.
Implementations§
Source§impl BufferedFile
impl BufferedFile
Sourcepub fn new(mount: Arc<dyn Mount>, fh: Bytes) -> Self
pub fn new(mount: Arc<dyn Mount>, fh: Bytes) -> Self
Own one OPEN reference for fh; every separately constructed wrapper
must receive its own reference obtained via Mount::open/create.
pub async fn read_at(&self, offset: u64, len: u32) -> Result<Bytes>
pub async fn write_at(&self, offset: u64, data: Bytes) -> Result<()>
pub async fn flush(&self) -> Result<()>
pub async fn close(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BufferedFile
impl !RefUnwindSafe for BufferedFile
impl !UnwindSafe for BufferedFile
impl Send for BufferedFile
impl Sync for BufferedFile
impl Unpin for BufferedFile
impl UnsafeUnpin for BufferedFile
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