pub struct LocalFileSystemProvider { /* private fields */ }Expand description
Creates local filesystem resolutions for accepted file: configurations.
§Examples
use qubit_fs::path::ConnectionUri;
use qubit_fs_registry::{FileSystemConfig, FileSystemRegistry};
use qubit_fs_local::{LocalFileSystemProvider, LocalResourcePolicy};
let registry = FileSystemRegistry::default();
registry.register(LocalFileSystemProvider::host(LocalResourcePolicy::standard()))?;
let config = FileSystemConfig::new(ConnectionUri::parse("file:///reports/summary.csv")?);
let resolution = registry.resolve_config(&config)?;
assert_eq!(resolution.path().as_str(), "/reports/summary.csv");
assert_eq!(resolution.file_system().properties().info().provider_id(), "local-file");Implementations§
Source§impl LocalFileSystemProvider
impl LocalFileSystemProvider
Sourcepub const fn host(policy: LocalResourcePolicy) -> Self
pub const fn host(policy: LocalResourcePolicy) -> Self
Creates a host-wide local provider.
§Parameters
policy: Resource ceilings applied to local filesystem operations.
§Returns
A provider that resolves absolute file: paths against the process
host filesystem.
§Examples
use qubit_fs::path::ConnectionUri;
use qubit_fs_registry::{FileSystemConfig, FileSystemRegistry};
use qubit_fs_local::{LocalFileSystemProvider, LocalResourcePolicy};
let registry = FileSystemRegistry::default();
registry.register(LocalFileSystemProvider::host(LocalResourcePolicy::standard()))?;
let config = FileSystemConfig::new(ConnectionUri::parse("file:///reports/summary.csv")?);
let resolution = registry.resolve_config(&config)?;
assert_eq!(resolution.path().as_str(), "/reports/summary.csv");
assert_eq!(resolution.file_system().properties().info().provider_id(), "local-file");Sourcepub fn rooted(
id: FileSystemId,
root: &Path,
policy: LocalResourcePolicy,
) -> Result<Self, FsError>
pub fn rooted( id: FileSystemId, root: &Path, policy: LocalResourcePolicy, ) -> Result<Self, FsError>
Creates a provider restricted to root with the supplied stable
identity.
§Parameters
id: Stable identity exposed by each resolved rooted filesystem.root: Native directory retained as the provider authority.
§Returns
A provider that resolves accepted paths below the opened root.
The default descriptor is local-file with the file URI alias.
§Errors
Returns an error when root cannot be opened as the provider’s native
authority. No provider is returned in that case, so it cannot be
registered or considered by a later fallback resolution.
Sourcepub fn rooted_with_descriptor(
descriptor: ProviderDescriptor,
id: FileSystemId,
root: &Path,
policy: LocalResourcePolicy,
) -> Result<Self, FsError>
pub fn rooted_with_descriptor( descriptor: ProviderDescriptor, id: FileSystemId, root: &Path, policy: LocalResourcePolicy, ) -> Result<Self, FsError>
Creates a rooted provider with caller-specified registration metadata.
The descriptor ID is also exposed by the configured filesystem, so
multiple rooted local providers can coexist in one registry when they
use distinct IDs and aliases. The supplied descriptor is retained as
provided, including its aliases; this constructor does not add the
default file alias.
§Parameters
descriptor: Registration identity and URI aliases to retain.id: Stable filesystem identity exposed by resolved instances.root: Native directory retained as provider authority.policy: Recursive resource and lifecycle policy.
§Returns
A provider retaining the opened rooted authority and descriptor.
§Errors
Returns an error when the root cannot be opened or the provider identity cannot be assembled.
Sourcepub fn temp_cleanup_control(&self) -> LocalTempCleanupControl
pub fn temp_cleanup_control(&self) -> LocalTempCleanupControl
Returns a clone of the shared temporary cleanup configuration.
Host resolutions, rooted resources, and provider clones use this shared
control. Retain the returned handle to adjust the budget for subsequent
cleanup attempts. An attempt already in progress uses its starting
snapshot; setting None explicitly selects unbounded cleanup. This
accessor does not restore cleanup authority for an indeterminate source.
Trait Implementations§
Source§impl Clone for LocalFileSystemProvider
impl Clone for LocalFileSystemProvider
Source§impl ProviderMetadata for LocalFileSystemProvider
impl ProviderMetadata for LocalFileSystemProvider
Source§fn descriptor(&self) -> ProviderDescriptor
fn descriptor(&self) -> ProviderDescriptor
Returns the stable local-provider descriptor and the file alias.
§Returns
The retained registration descriptor. Host providers and rooted
providers created by Self::rooted use the default local-file
descriptor with the file alias; Self::rooted_with_descriptor
preserves the caller-supplied descriptor unchanged.
Source§impl ServiceProvider<FileSystemSpec> for LocalFileSystemProvider
impl ServiceProvider<FileSystemSpec> for LocalFileSystemProvider
Source§fn create_configured(
&self,
config: &FileSystemConfig,
) -> Result<FileSystemResolution, ProviderFailure<FsError>>
fn create_configured( &self, config: &FileSystemConfig, ) -> Result<FileSystemResolution, ProviderFailure<FsError>>
Resolves one accepted file: configuration to a concrete facade.
§Parameters
config: Provider configuration to validate and resolve.
§Returns
A concrete filesystem, decoded logical path, and canonical URI.
§Errors
Returns an invalid-configuration failure for unsupported configuration shapes or an initialization failure when the selected local filesystem cannot be opened or assembled.