Skip to main content

DetachedFile

Struct DetachedFile 

Source
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>

Source

pub const fn file_id(&self) -> FileId

Stable file identity retained across last-link removal.

Source

pub fn logical_bytes(&self) -> u64

Current detached logical file length.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>
where Volume<A, O>: Freeze,

§

impl<A, O> Send for DetachedFile<A, O>
where Volume<A, O>: Send,

§

impl<A, O> Sync for DetachedFile<A, O>
where Volume<A, O>: Sync,

§

impl<A, O> Unpin for DetachedFile<A, O>
where Volume<A, O>: Unpin,

§

impl<A, O> UnsafeUnpin for DetachedFile<A, O>
where Volume<A, O>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StorageFuture for T
where T: Send,

Source§

impl<T> StorageProvider for T
where T: Send + Sync + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more