pub trait MountOpenFile:
Send
+ Sync
+ 'static {
Show 14 methods
// Required methods
fn lookup(&self) -> Result<MountLookup, MountSourceError>;
fn read_range(
&self,
offset: u64,
length: u32,
) -> Result<Bytes, MountSourceError>;
fn read_up_to(
&self,
offset: u64,
maximum_bytes: u32,
) -> Result<Bytes, MountSourceError>;
fn seek(
&self,
offset: u64,
target: MountSeekTarget,
) -> Result<Option<u64>, MountSourceError>;
fn write_range(
&self,
offset: u64,
bytes: Bytes,
) -> Result<(), MountSourceError>;
fn resize(&self, logical_bytes: u64) -> Result<(), MountSourceError>;
fn allocate_range(
&self,
offset: u64,
length: u64,
operation: MountRangeAllocation,
) -> Result<(), MountSourceError>;
fn set_attributes(
&self,
metadata: FileMetadata,
logical_bytes: Option<u64>,
) -> Result<(), MountSourceError>;
fn read_attribute(
&self,
name: &[u8],
) -> Result<Option<Bytes>, MountSourceError>;
fn list_attributes(
&self,
cursor: Option<&[u8]>,
maximum_entries: u32,
) -> Result<MountAttributePage, MountSourceError>;
fn write_attribute(
&self,
name: &[u8],
value: Bytes,
mode: MountAttributeWriteMode,
) -> Result<(), MountSourceError>;
fn remove_attribute(&self, name: &[u8]) -> Result<(), MountSourceError>;
// Provided methods
fn read_sparse_range(
&self,
offset: u64,
length: u32,
) -> Result<MountSparseRange, MountSourceError> { ... }
fn write_sparse_range(
&self,
offset: u64,
range: &MountSparseRange,
) -> Result<(), MountSourceError> { ... }
}Expand description
Path-independent regular-file handle used for every native open operation.
Attached implementations mutate the authenticated checkout by stable
FileId, so rename and unlink of one hard-link name
cannot stale the handle. After final-link removal, drivers replace all
handles for the inode with one shared detached implementation.
Required Methods§
Sourcefn lookup(&self) -> Result<MountLookup, MountSourceError>
fn lookup(&self) -> Result<MountLookup, MountSourceError>
Returns current identity, size, and metadata for fstat-style calls.
§Errors
Returns stale, cancellation, or authenticated engine failures.
Sourcefn read_range(
&self,
offset: u64,
length: u32,
) -> Result<Bytes, MountSourceError>
fn read_range( &self, offset: u64, length: u32, ) -> Result<Bytes, MountSourceError>
Reads one exact bounded logical range.
§Errors
Returns range, storage, authentication, cancellation, or work failures.
Sourcefn read_up_to(
&self,
offset: u64,
maximum_bytes: u32,
) -> Result<Bytes, MountSourceError>
fn read_up_to( &self, offset: u64, maximum_bytes: u32, ) -> Result<Bytes, MountSourceError>
Reads at most maximum_bytes, clipping to EOF in the same coherent view.
§Errors
Returns the same typed failures as Self::read_range.
Sourcefn seek(
&self,
offset: u64,
target: MountSeekTarget,
) -> Result<Option<u64>, MountSourceError>
fn seek( &self, offset: u64, target: MountSeekTarget, ) -> Result<Option<u64>, MountSourceError>
Finds the next sparse data or hole boundary.
§Errors
Returns sparse-tree, storage, authentication, cancellation, or work failures.
Sourcefn write_range(&self, offset: u64, bytes: Bytes) -> Result<(), MountSourceError>
fn write_range(&self, offset: u64, bytes: Bytes) -> Result<(), MountSourceError>
Replaces one exact byte range in the detached file.
§Errors
Returns range, storage, cancellation, allocation, or work failures.
Sourcefn resize(&self, logical_bytes: u64) -> Result<(), MountSourceError>
fn resize(&self, logical_bytes: u64) -> Result<(), MountSourceError>
Changes the detached logical file length.
§Errors
Returns sparse-tree, storage, cancellation, allocation, or work failures.
Sourcefn allocate_range(
&self,
offset: u64,
length: u64,
operation: MountRangeAllocation,
) -> Result<(), MountSourceError>
fn allocate_range( &self, offset: u64, length: u64, operation: MountRangeAllocation, ) -> Result<(), MountSourceError>
Applies one exact sparse allocation operation.
§Errors
Returns unsupported, range, storage, cancellation, allocation, or work failures.
Sourcefn set_attributes(
&self,
metadata: FileMetadata,
logical_bytes: Option<u64>,
) -> Result<(), MountSourceError>
fn set_attributes( &self, metadata: FileMetadata, logical_bytes: Option<u64>, ) -> Result<(), MountSourceError>
Replaces complete metadata and optionally logical size atomically from the native handle’s perspective.
§Errors
Returns metadata, sparse-tree, storage, cancellation, allocation, or work failures.
Sourcefn read_attribute(&self, name: &[u8]) -> Result<Option<Bytes>, MountSourceError>
fn read_attribute(&self, name: &[u8]) -> Result<Option<Bytes>, MountSourceError>
Reads one exact native named attribute.
§Errors
Returns absence, unsupported-profile, storage, authentication, or work failures.
Sourcefn list_attributes(
&self,
cursor: Option<&[u8]>,
maximum_entries: u32,
) -> Result<MountAttributePage, MountSourceError>
fn list_attributes( &self, cursor: Option<&[u8]>, maximum_entries: u32, ) -> Result<MountAttributePage, MountSourceError>
Lists one bounded page of native named-attribute names.
§Errors
Returns unsupported-profile, pagination, storage, authentication, or work failures.
Sourcefn write_attribute(
&self,
name: &[u8],
value: Bytes,
mode: MountAttributeWriteMode,
) -> Result<(), MountSourceError>
fn write_attribute( &self, name: &[u8], value: Bytes, mode: MountAttributeWriteMode, ) -> Result<(), MountSourceError>
Inserts or replaces one exact native named attribute.
§Errors
Returns precondition, unsupported-profile, storage, or work failures.
Sourcefn remove_attribute(&self, name: &[u8]) -> Result<(), MountSourceError>
fn remove_attribute(&self, name: &[u8]) -> Result<(), MountSourceError>
Removes one exact native named attribute.
§Errors
Returns absence, unsupported-profile, storage, or work failures.
Provided Methods§
Sourcefn read_sparse_range(
&self,
offset: u64,
length: u32,
) -> Result<MountSparseRange, MountSourceError>
fn read_sparse_range( &self, offset: u64, length: u32, ) -> Result<MountSparseRange, MountSourceError>
Reads one bounded sparse range without materializing holes.
§Errors
Returns stale, range, storage, authentication, cancellation, allocation, or bounded-work failures.
Sourcefn write_sparse_range(
&self,
offset: u64,
range: &MountSparseRange,
) -> Result<(), MountSourceError>
fn write_sparse_range( &self, offset: u64, range: &MountSparseRange, ) -> Result<(), MountSourceError>
Replaces one range from a sparse snapshot, preserving every hole.
§Errors
Returns stale, range, sparse-tree, storage, cancellation, allocation, or bounded-work failures. Native callers treat partial failures as a short copy and never report unverified completion.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".