pub trait NetworkFilesystem: Filesystem {
// Provided methods
fn network_configuration(&self) -> NetworkConfiguration { ... }
fn open_file(&self, _inode: u64, _writable: bool) -> Result<NetworkFile> { ... }
fn close_file(&self, _inode: u64, _file: NetworkFile) -> Result<()> { ... }
}Expand description
Additional lifecycle hooks for lazy network filesystems.
Namespace operations remain demand-driven methods on the parent
Filesystem trait. The open/close lease allows explicitly downloaded files
to use local I/O without giving Swift ownership of cache eviction.
Provided Methods§
fn network_configuration(&self) -> NetworkConfiguration
Sourcefn open_file(&self, _inode: u64, _writable: bool) -> Result<NetworkFile>
fn open_file(&self, _inode: u64, _writable: bool) -> Result<NetworkFile>
Selects the data source for an open file.
Returning NetworkFile::Remote leaves reads lazy. Returning
NetworkFile::Local guarantees the path remains valid until close_file.
§Errors
Returns a positive Darwin errno if the file can’t be opened.
Sourcefn close_file(&self, _inode: u64, _file: NetworkFile) -> Result<()>
fn close_file(&self, _inode: u64, _file: NetworkFile) -> Result<()>
Releases a file lease after Swift has closed any local descriptor.
This is a suitable point to update last-access state or schedule cache cleanup.
§Errors
Returns a positive Darwin errno if lease cleanup fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".