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
impl RoutedMountSource
Sourcepub fn add_route(
&self,
name: Vec<u8>,
source: Arc<dyn MountFilesystem>,
) -> Result<(), MountSourceError>
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.
Sourcepub fn remove_route(&self, name: &[u8]) -> bool
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.
Sourcepub fn route_count(&self) -> usize
pub fn route_count(&self) -> usize
Number of routes currently projected by this source.
Trait Implementations§
Source§impl Default for RoutedMountSource
impl Default for RoutedMountSource
Source§impl MountFilesystem for RoutedMountSource
impl MountFilesystem for RoutedMountSource
Source§fn supports_posix_named_attributes(&self) -> bool
fn supports_posix_named_attributes(&self) -> bool
Source§fn view_is_stable(&self) -> bool
fn view_is_stable(&self) -> bool
Source§fn view_epoch(&self) -> Option<u64>
fn view_epoch(&self) -> Option<u64>
Source§fn binding_epoch(&self) -> Option<u64>
fn binding_epoch(&self) -> Option<u64>
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>
fn acquire_view_lease( &self, expected_epoch: Option<u64>, ) -> Result<Box<dyn MountViewLease>, MountSourceError>
Source§fn acquire_binding_lease(
&self,
expected_epoch: Option<u64>,
) -> Result<Box<dyn MountViewLease>, MountSourceError>
fn acquire_binding_lease( &self, expected_epoch: Option<u64>, ) -> Result<Box<dyn MountViewLease>, MountSourceError>
Source§fn lookup(
&self,
path: &MountPath,
) -> Result<Option<MountLookup>, MountSourceError>
fn lookup( &self, path: &MountPath, ) -> Result<Option<MountLookup>, MountSourceError>
Source§fn open_file(
&self,
path: &MountPath,
) -> Result<Arc<dyn MountOpenFile>, MountSourceError>
fn open_file( &self, path: &MountPath, ) -> Result<Arc<dyn MountOpenFile>, MountSourceError>
Source§fn detach_file(
&self,
path: &MountPath,
) -> Result<Arc<dyn MountOpenFile>, MountSourceError>
fn detach_file( &self, path: &MountPath, ) -> Result<Arc<dyn MountOpenFile>, MountSourceError>
Source§fn read_link(&self, path: &MountPath) -> Result<Bytes, MountSourceError>
fn read_link(&self, path: &MountPath) -> Result<Bytes, MountSourceError>
Source§fn read_range(
&self,
path: &MountPath,
offset: u64,
length: u32,
) -> Result<Bytes, MountSourceError>
fn read_range( &self, path: &MountPath, offset: u64, length: u32, ) -> Result<Bytes, MountSourceError>
Source§fn seek(
&self,
path: &MountPath,
offset: u64,
target: MountSeekTarget,
) -> Result<Option<u64>, MountSourceError>
fn seek( &self, path: &MountPath, offset: u64, target: MountSeekTarget, ) -> Result<Option<u64>, MountSourceError>
Source§fn read_directory(
&self,
path: &MountPath,
cursor: Option<&[u8]>,
maximum_entries: u32,
) -> Result<MountDirectoryPage, MountSourceError>
fn read_directory( &self, path: &MountPath, cursor: Option<&[u8]>, maximum_entries: u32, ) -> Result<MountDirectoryPage, MountSourceError>
Source§fn create_file(
&self,
path: &MountPath,
metadata: FileMetadata,
) -> Result<MountLookup, MountSourceError>
fn create_file( &self, path: &MountPath, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>
Source§fn create_directory(
&self,
path: &MountPath,
metadata: FileMetadata,
) -> Result<MountLookup, MountSourceError>
fn create_directory( &self, path: &MountPath, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>
Source§fn create_symbolic_link(
&self,
path: &MountPath,
target: Bytes,
metadata: FileMetadata,
) -> Result<MountLookup, MountSourceError>
fn create_symbolic_link( &self, path: &MountPath, target: Bytes, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>
Source§fn create_special(
&self,
path: &MountPath,
kind: MountNodeKind,
device: Option<(u32, u32)>,
metadata: FileMetadata,
) -> Result<MountLookup, MountSourceError>
fn create_special( &self, path: &MountPath, kind: MountNodeKind, device: Option<(u32, u32)>, metadata: FileMetadata, ) -> Result<MountLookup, MountSourceError>
Source§fn set_attributes(
&self,
path: &MountPath,
metadata: FileMetadata,
logical_bytes: Option<u64>,
) -> Result<(), MountSourceError>
fn set_attributes( &self, path: &MountPath, metadata: FileMetadata, logical_bytes: Option<u64>, ) -> Result<(), MountSourceError>
Source§fn read_attribute(
&self,
path: &MountPath,
name: &[u8],
) -> Result<Option<Bytes>, MountSourceError>
fn read_attribute( &self, path: &MountPath, name: &[u8], ) -> Result<Option<Bytes>, MountSourceError>
Source§fn list_attributes(
&self,
path: &MountPath,
cursor: Option<&[u8]>,
maximum_entries: u32,
) -> Result<MountAttributePage, MountSourceError>
fn list_attributes( &self, path: &MountPath, cursor: Option<&[u8]>, maximum_entries: u32, ) -> Result<MountAttributePage, MountSourceError>
Source§fn write_attribute(
&self,
path: &MountPath,
name: &[u8],
value: Bytes,
mode: MountAttributeWriteMode,
) -> Result<(), MountSourceError>
fn write_attribute( &self, path: &MountPath, name: &[u8], value: Bytes, mode: MountAttributeWriteMode, ) -> Result<(), MountSourceError>
Source§fn remove_attribute(
&self,
path: &MountPath,
name: &[u8],
) -> Result<(), MountSourceError>
fn remove_attribute( &self, path: &MountPath, name: &[u8], ) -> Result<(), MountSourceError>
Source§fn write_range(
&self,
path: &MountPath,
offset: u64,
bytes: Bytes,
) -> Result<(), MountSourceError>
fn write_range( &self, path: &MountPath, offset: u64, bytes: Bytes, ) -> Result<(), MountSourceError>
Source§fn resize(
&self,
path: &MountPath,
logical_bytes: u64,
) -> Result<(), MountSourceError>
fn resize( &self, path: &MountPath, logical_bytes: u64, ) -> Result<(), MountSourceError>
Source§fn allocate_range(
&self,
path: &MountPath,
offset: u64,
length: u64,
operation: MountRangeAllocation,
) -> Result<(), MountSourceError>
fn allocate_range( &self, path: &MountPath, offset: u64, length: u64, operation: MountRangeAllocation, ) -> Result<(), MountSourceError>
Source§fn clone_range(
&self,
source: &MountPath,
source_offset: u64,
destination: &MountPath,
destination_offset: u64,
length: u64,
) -> Result<(), MountSourceError>
fn clone_range( &self, source: &MountPath, source_offset: u64, destination: &MountPath, destination_offset: u64, length: u64, ) -> Result<(), MountSourceError>
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>
fn clone_range_by_id( &self, source_file_id: FileId, source_offset: u64, destination_file_id: FileId, destination_offset: u64, length: u64, ) -> Result<(), MountSourceError>
Source§fn remove(
&self,
path: &MountPath,
expected: Option<FileId>,
) -> Result<(), MountSourceError>
fn remove( &self, path: &MountPath, expected: Option<FileId>, ) -> Result<(), MountSourceError>
Source§fn rename(
&self,
source: &MountPath,
destination: &MountPath,
replace: bool,
) -> Result<(), MountSourceError>
fn rename( &self, source: &MountPath, destination: &MountPath, replace: bool, ) -> Result<(), MountSourceError>
Source§fn hard_link(
&self,
source: &MountPath,
destination: &MountPath,
) -> Result<(), MountSourceError>
fn hard_link( &self, source: &MountPath, destination: &MountPath, ) -> Result<(), MountSourceError>
Source§fn flush(&self) -> Result<(), MountSourceError>
fn flush(&self) -> Result<(), MountSourceError>
Source§fn capture_host_path(
&self,
source_root: &Path,
path: &MountPath,
) -> Result<(), MountSourceError>
fn capture_host_path( &self, source_root: &Path, path: &MountPath, ) -> Result<(), MountSourceError>
Source§fn capture_host_paths(
&self,
source_root: &Path,
paths: &[MountPath],
) -> Result<(), MountSourceError>
fn capture_host_paths( &self, source_root: &Path, paths: &[MountPath], ) -> Result<(), MountSourceError>
Source§fn capture_host_subtree(
&self,
source_root: &Path,
path: &MountPath,
) -> Result<(), MountSourceError>
fn capture_host_subtree( &self, source_root: &Path, path: &MountPath, ) -> Result<(), MountSourceError>
Source§fn flush_on_handle_close(&self) -> bool
fn flush_on_handle_close(&self) -> bool
Auto Trait Implementations§
impl !Freeze for RoutedMountSource
impl RefUnwindSafe for RoutedMountSource
impl Send for RoutedMountSource
impl Sync for RoutedMountSource
impl Unpin for RoutedMountSource
impl UnsafeUnpin for RoutedMountSource
impl UnwindSafe for RoutedMountSource
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