pub struct DetachedFile<A, O> { /* private fields */ }Expand description
Ephemeral path-independent regular file retained by an open native handle.
Detached files share immutable objects with their originating volume but are never published into a generation. They exist only until the final native handle closes, matching POSIX last-unlink lifetime semantics.
Implementations§
Source§impl<A: AsyncAuthorityStore, O: AsyncObjectStore> DetachedFile<A, O>
impl<A: AsyncAuthorityStore, O: AsyncObjectStore> DetachedFile<A, O>
Sourcepub fn logical_bytes(&self) -> u64
pub fn logical_bytes(&self) -> u64
Current detached logical file length.
Sourcepub async fn seek(
&self,
offset: u64,
target: ExtentSeekTarget,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<Option<u64>>
pub async fn seek( &self, offset: u64, target: ExtentSeekTarget, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<Option<u64>>
Finds the first sparse data or hole boundary without a namespace binding.
§Errors
Returns measured malformed-extent, cancellation, backend, allocation, or bounded-work failures.
Sourcepub async fn set_metadata(
&mut self,
metadata: FileMetadata,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn set_metadata( &mut self, metadata: FileMetadata, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Replaces complete metadata on this detached file only.
§Errors
Returns measured encoding, storage, cancellation, allocation, or bounded-work failures. A failed operation leaves the detached record unchanged.
Sourcepub async fn set_attributes(
&mut self,
metadata: FileMetadata,
logical_bytes: Option<u64>,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn set_attributes( &mut self, metadata: FileMetadata, logical_bytes: Option<u64>, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Replaces complete metadata and optionally logical size as one detached record transition.
Immutable metadata bytes may be staged before validation finishes, but the visible detached record changes only after every requested update succeeds.
§Errors
Returns measured encoding, storage, sparse mutation, cancellation, allocation, or bounded-work failures.
Sourcepub async fn read_named_attribute(
&self,
name: &AttributeName,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<Option<Bytes>>
pub async fn read_named_attribute( &self, name: &AttributeName, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<Option<Bytes>>
Reads one exact named attribute from the detached metadata frontier.
§Errors
Returns measured metadata, attribute-tree, blob, storage, authentication, cancellation, allocation, or bounded-work failures.
Sourcepub async fn list_named_attributes(
&self,
after: Option<&AttributeName>,
maximum_entries: u32,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<AttributeListing>
pub async fn list_named_attributes( &self, after: Option<&AttributeName>, maximum_entries: u32, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<AttributeListing>
Lists one bounded page of detached named-attribute identities.
§Errors
Returns measured metadata, pagination, storage, authentication, cancellation, allocation, or bounded-work failures.
Sourcepub async fn write_named_attribute(
&mut self,
name: AttributeName,
value: Bytes,
mode: NamedAttributeWriteMode,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<FileMetadata>
pub async fn write_named_attribute( &mut self, name: AttributeName, value: Bytes, mode: NamedAttributeWriteMode, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<FileMetadata>
Inserts or replaces one detached named attribute atomically.
§Errors
Returns measured precondition, metadata, blob, attribute-tree, storage, cancellation, allocation, or bounded-work failures.
Sourcepub async fn remove_named_attribute(
&mut self,
name: AttributeName,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<FileMetadata>
pub async fn remove_named_attribute( &mut self, name: AttributeName, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<FileMetadata>
Removes one existing detached named attribute atomically.
§Errors
Returns authenticated absence or the same measured failures as
Self::write_named_attribute.
Sourcepub async fn read_metadata(
&self,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<FileMetadata>
pub async fn read_metadata( &self, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<FileMetadata>
Reads complete authenticated metadata for this detached file.
§Errors
Returns measured storage, authentication, cancellation, allocation, or bounded-work failures.
Sourcepub async fn read_range(
&self,
range: ByteRange,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<FileRangeRead>
pub async fn read_range( &self, range: ByteRange, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<FileRangeRead>
Reads one bounded sparse range without requiring a namespace binding.
§Errors
Returns typed range, storage, authentication, cancellation, allocation, or bounded-work failures.
Sourcepub async fn write_range(
&mut self,
offset: u64,
bytes: Bytes,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn write_range( &mut self, offset: u64, bytes: Bytes, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Writes caller bytes into the detached sparse file.
§Errors
Returns typed range, blob, mutation, storage, cancellation, allocation, or bounded-work failures.
Sourcepub async fn resize(
&mut self,
logical_bytes: u64,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn resize( &mut self, logical_bytes: u64, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Changes detached logical file length.
§Errors
Returns typed mutation, storage, cancellation, allocation, or work failures.
Sourcepub async fn zero_range(
&mut self,
range: ByteRange,
allocated: bool,
extend: bool,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn zero_range( &mut self, range: ByteRange, allocated: bool, extend: bool, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Replaces one detached range with a hole or allocated zeros.
§Errors
Returns typed mutation, storage, cancellation, allocation, or work failures.
Sourcepub async fn preallocate(
&mut self,
range: ByteRange,
keep_size: bool,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> FsResult<()>
pub async fn preallocate( &mut self, range: ByteRange, keep_size: bool, budget: WorkBudget, cancellation: &CancellationToken, ) -> FsResult<()>
Allocates detached sparse holes while preserving content.
§Errors
Returns typed unsupported keep-size, mutation, storage, cancellation, allocation, or work failures.
Auto Trait Implementations§
impl<A, O> !RefUnwindSafe for DetachedFile<A, O>
impl<A, O> !UnwindSafe for DetachedFile<A, O>
impl<A, O> Freeze for DetachedFile<A, O>
impl<A, O> Send for DetachedFile<A, O>
impl<A, O> Sync for DetachedFile<A, O>
impl<A, O> Unpin for DetachedFile<A, O>
impl<A, O> UnsafeUnpin for DetachedFile<A, O>where
Volume<A, O>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request