Skip to main content

LocalFileSystemProvider

Struct LocalFileSystemProvider 

Source
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

Source

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");
Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Clones the provider while preserving its mode, descriptor, policy, and current shared cleanup configuration.

1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ProviderMetadata for LocalFileSystemProvider

Source§

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

Source§

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.

Source§

fn create( &self, ) -> Result<<S as SyncServiceSpec>::Output, ProviderFailure<<S as ServiceSpec>::Error>>
where <S as ServiceSpec>::Config: Default,

Creates one service output with the configuration default. 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<S, T> ProviderDefinition<S> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.