Skip to main content

RoutedMountSource

Struct RoutedMountSource 

Source
pub struct RoutedMountSource { /* private fields */ }
Expand description

A MountFilesystem that routes by first path component to a live-mutable set of child sources, each exposed as a subdirectory of one synthetic root.

Every FileId a route hands back is XORed with that route’s tag before leaving this type, since routes fronting checkouts of the same volume otherwise return colliding stable ids for unchanged files. The mapping is deliberately one-way: clone_range_by_id and remove’s expected-id precondition resolve a remapped id back to its owning route through an index recorded every time an id is emitted, then undo the same XOR.

Implementations§

Source§

impl RoutedMountSource

Source

pub fn new() -> Self

Creates one router with no routes.

Source

pub fn add_route( &self, name: Vec<u8>, source: Arc<dyn MountFilesystem>, ) -> Result<(), MountSourceError>

Adds one route under name, exposed as /name from the mount root.

§Errors

Returns MountSourceError::Invalid for an empty or ./.. name, and MountSourceError::AlreadyExists for a name already routed.

Source

pub fn remove_route(&self, name: &[u8]) -> bool

Removes the route named name, if any. Open handles into it keep working detached; only new lookups stop finding it.

Returns whether a route was actually removed.

Source

pub fn is_empty(&self) -> bool

Returns whether no route is currently registered.

Source

pub fn route_count(&self) -> usize

Number of routes currently projected by this source.

Trait Implementations§

Source§

impl Default for RoutedMountSource

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MountFilesystem for RoutedMountSource

Source§

fn supports_posix_named_attributes(&self) -> bool

Whether this source can represent native POSIX named attributes. Read more
Source§

fn view_is_stable(&self) -> bool

Whether a lookup may observe one coherent source view right now. Drivers must retry or fail stale while this is false.
Source§

fn view_epoch(&self) -> Option<u64>

Returns the current coherent projection view, when the source can precisely invalidate cached lookups. Read more
Source§

fn binding_epoch(&self) -> Option<u64>

Changes only when existing path or handle bindings may be replaced by an external source transition. Ordinary mutations may advance view_epoch to invalidate caches without making a native callback stale. Sources without that distinction retain the conservative view epoch behavior.
Source§

fn acquire_view_lease( &self, expected_epoch: Option<u64>, ) -> Result<Box<dyn MountViewLease>, MountSourceError>

Pins the current coherent projection view for one native callback. Read more
Source§

fn acquire_binding_lease( &self, expected_epoch: Option<u64>, ) -> Result<Box<dyn MountViewLease>, MountSourceError>

Pins source binding identity without treating ordinary native writes as an external rebind. A callback must separately validate its cache epoch before reusing a lookup result.
Source§

fn lookup( &self, path: &MountPath, ) -> Result<Option<MountLookup>, MountSourceError>

Looks up one absolute portable path without following links. Read more
Source§

fn open_file( &self, path: &MountPath, ) -> Result<Arc<dyn MountOpenFile>, MountSourceError>

Opens one regular file as an attached path-independent handle. Read more
Source§

fn detach_file( &self, path: &MountPath, ) -> Result<Arc<dyn MountOpenFile>, MountSourceError>

Captures one regular file as a detached path-independent open-file view. Read more
Reads one symbolic link’s exact opaque target bytes without following it. Read more
Source§

fn read_range( &self, path: &MountPath, offset: u64, length: u32, ) -> Result<Bytes, MountSourceError>

Reads at most one exact logical range. Read more
Source§

fn seek( &self, path: &MountPath, offset: u64, target: MountSeekTarget, ) -> Result<Option<u64>, MountSourceError>

Finds the first sparse data or hole byte at/after one offset. Read more
Source§

fn read_directory( &self, path: &MountPath, cursor: Option<&[u8]>, maximum_entries: u32, ) -> Result<MountDirectoryPage, MountSourceError>

Reads one bounded page using a handle-owned opaque cursor. Read more
Source§

fn create_file( &self, path: &MountPath, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>

Creates one empty regular file. Read more
Source§

fn create_directory( &self, path: &MountPath, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>

Creates one empty directory. Read more
Creates one symbolic link with an exact opaque target. Read more
Source§

fn create_special( &self, path: &MountPath, kind: MountNodeKind, device: Option<(u32, u32)>, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>

Creates one FIFO, socket, character device, or block device. Read more
Source§

fn set_attributes( &self, path: &MountPath, metadata: FileMetadata, logical_bytes: Option<u64>, ) -> Result<(), MountSourceError>

Atomically replaces complete metadata and optionally logical size. Read more
Source§

fn read_attribute( &self, path: &MountPath, name: &[u8], ) -> Result<Option<Bytes>, MountSourceError>

Reads one exact native named attribute. Read more
Source§

fn list_attributes( &self, path: &MountPath, cursor: Option<&[u8]>, maximum_entries: u32, ) -> Result<MountAttributePage, MountSourceError>

Lists one bounded page of native named-attribute names. Read more
Source§

fn write_attribute( &self, path: &MountPath, name: &[u8], value: Bytes, mode: MountAttributeWriteMode, ) -> Result<(), MountSourceError>

Inserts or replaces one exact native named attribute. Read more
Source§

fn remove_attribute( &self, path: &MountPath, name: &[u8], ) -> Result<(), MountSourceError>

Removes one exact native named attribute. Read more
Source§

fn write_range( &self, path: &MountPath, offset: u64, bytes: Bytes, ) -> Result<(), MountSourceError>

Replaces one exact file range. Read more
Source§

fn resize( &self, path: &MountPath, logical_bytes: u64, ) -> Result<(), MountSourceError>

Changes one file’s logical length. Read more
Source§

fn allocate_range( &self, path: &MountPath, offset: u64, length: u64, operation: MountRangeAllocation, ) -> Result<(), MountSourceError>

Applies one exact sparse allocation operation. Read more
Source§

fn clone_range( &self, source: &MountPath, source_offset: u64, destination: &MountPath, destination_offset: u64, length: u64, ) -> Result<(), MountSourceError>

Clones one immutable range between regular files without reading bytes. Read more
Source§

fn clone_range_by_id( &self, source_file_id: FileId, source_offset: u64, destination_file_id: FileId, destination_offset: u64, length: u64, ) -> Result<(), MountSourceError>

Clones one logical range between stable attached file identities. Read more
Source§

fn remove( &self, path: &MountPath, expected: Option<FileId>, ) -> Result<(), MountSourceError>

Removes one namespace binding. Read more
Source§

fn rename( &self, source: &MountPath, destination: &MountPath, replace: bool, ) -> Result<(), MountSourceError>

Renames one binding atomically within the volume. Read more
Creates one same-volume hard link. Read more
Source§

fn flush(&self) -> Result<(), MountSourceError>

Seals all pending authored mutations through the checkout’s configured fenced publication path before acknowledging native durability. Read more
Source§

fn capture_host_path( &self, source_root: &Path, path: &MountPath, ) -> Result<(), MountSourceError>

Reconciles exact final host state for one projected path and seals it. Read more
Source§

fn capture_host_paths( &self, source_root: &Path, paths: &[MountPath], ) -> Result<(), MountSourceError>

Reconciles exact final host states together, preserving hard-link topology and admitting one bounded checkout candidate. Read more
Source§

fn capture_host_subtree( &self, source_root: &Path, path: &MountPath, ) -> Result<(), MountSourceError>

Reconciles one imported directory and every descendant atomically. Read more
Source§

fn flush_on_handle_close(&self) -> bool

Whether a native handle close is itself a publication boundary. Read more

Auto Trait Implementations§

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