pub struct FsFile<F: HandleBackend> { /* private fields */ }Expand description
Owned RAII file which does not borrow the client.
File operations use the owning client’s Vfsi implementation. Dropping an
open file queues cleanup without waiting for the backend lock. Dropping the
final connection owner can perform synchronous teardown. Use try_close
when the close result matters.
Implementations§
Source§impl<F: HandleBackend> FsFile<F>
impl<F: HandleBackend> FsFile<F>
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Whether explicit close has completed successfully on this handle.
pub fn read_request_at(&self, offset: u64, length: usize) -> FsRead<'_, F>
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
Name used at open, retained for diagnostics; not a current namespace lookup or proof of identity. Handle operations continue to use the opened object even if its pathname changes.
pub fn write_request_at<'a>( &'a self, offset: u64, data: &'a [u8], ) -> FsWrite<'a, F>
pub fn read_request_at_into<'a>( &'a self, offset: u64, buffer: &'a mut [u8], ) -> FsReadInto<'a, F>
Sourcepub fn try_close(&mut self) -> VfResult<()>
pub fn try_close(&mut self) -> VfResult<()>
Attempt to close without consuming the handle. A failed close leaves
the handle armed so the caller can reconcile or retry cleanup explicitly.
After an ambiguous close failure, remote state is unknown: do not resume
data I/O just because is_closed() is false. This is local ownership,
not proof that the server still has the descriptor open.