pub struct OpenFile {
pub path: String,
pub rel: String,
pub is_dir: bool,
pub can_read: bool,
pub can_write: bool,
pub delete_on_close: bool,
pub delete_pending: bool,
pub inner: Box<dyn Any>,
}Expand description
An open file or directory handle owned by a backend.
The server tracks common bookkeeping (path, access flags, delete state);
backend-private state lives in OpenFile::inner.
Fields§
§path: StringBackend-relative path this handle was opened on (kept in sync across rename-by-handle).
rel: StringShare-relative client path the handle was opened on (backslashes
normalized to \), empty for the share root. Lets protocol layers
re-enumerate or re-stat without re-deriving paths from storage.
is_dir: boolTrue when the handle refers to a directory.
can_read: boolRead data access was granted at open time.
can_write: boolWrite/append/delete-data access was granted at open time.
delete_on_close: boolDelete-on-close requested via create options.
delete_pending: boolDeletion requested through SET_INFORMATION; applied on close.
inner: Box<dyn Any>Opaque backend state (file descriptor wrapper, cached cursor, …).
Not Send/Sync: io_uring resources (tokio_uring::fs::File) are
!Send, and per-connection state is driven entirely on one thread.
Implementations§
Source§impl OpenFile
impl OpenFile
Sourcepub fn inner_as<T: 'static>(&self) -> Option<&T>
pub fn inner_as<T: 'static>(&self) -> Option<&T>
Downcast the backend-private state to a concrete type.
Sourcepub fn inner_as_ref<T: 'static>(&self) -> Option<&T>
pub fn inner_as_ref<T: 'static>(&self) -> Option<&T>
Immutably downcast the backend-private state (alias of Self::inner_as).
Sourcepub fn inner_as_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn inner_as_mut<T: 'static>(&mut self) -> Option<&mut T>
Mutably downcast the backend-private state to a concrete type.