Skip to main content

Crate qubit_fs_registry

Crate qubit_fs_registry 

Source
Expand description

Provider registration and registry integration for qubit_fs.

§Register providers first

FileSystemRegistry::default() creates an empty registry. Register a provider with FileSystemRegistry::register or FileSystemRegistry::register_shared during startup before resolving connections. URI-based resolution selects by scheme, so the provider ID or one of its aliases must match that selection.

The quick-start functions below accept registries whose providers have already been registered. See the user guides below for complete provider registration examples.

§Features

FeatureAvailable integration
Default (empty set)Synchronous registry with explicit registration.
asyncAsynchronous registry with explicit registration; no implicit blocking adapter.
inventorySynchronous from_inventory() discovery of linked provider submissions.
async + inventoryAsynchronous discovery is also available.

Inventory discovery still requires linking the provider crate that submits the factories.

§Quick start

use qubit_fs::path::ConnectionUri;
use qubit_fs_registry::{
    FileSystemConfig,
    FileSystemRegistry,
};

fn resolve_from_registered_providers(
    registry: &FileSystemRegistry,
) -> Result<(), Box<dyn std::error::Error>> {
    let config = FileSystemConfig::new(ConnectionUri::parse("file:///tmp/example")?);
    let _resolution = registry.resolve_config(&config)?;
    Ok(())
}

§Async quick start

use qubit_fs::path::ConnectionUri;
use qubit_fs_registry::{AsyncFileSystemRegistry, FileSystemConfig};

async fn resolve_from_registered_async_providers(
    registry: &AsyncFileSystemRegistry,
) -> Result<(), Box<dyn std::error::Error>> {
    let config = FileSystemConfig::new(ConnectionUri::parse("file:///tmp/example")?);
    let _resolution = registry.resolve_config(config).await?;
    Ok(())
}

§Learn more

Modules§

async_file_system_providers
Link-time provider inventory for one concrete service family.
sync_file_system_providers
Link-time provider inventory for one concrete service family.

Structs§

AsyncFileSystemRegistry
Shared registry of self-described asynchronous filesystem providers.
AsyncFileSystemResolution
A configured asynchronous facade paired with its decoded location.
FileSystemConfig
Complete configuration passed to a filesystem provider factory.
FileSystemRegistry
Shared registry of self-described synchronous filesystem providers.
FileSystemResolution
A configured synchronous facade paired with its decoded location.
FileSystemSpec
Service specification for filesystem providers.

Enums§

CredentialRef
Reference to credentials that must not contain secret material.
FileSystemRegistryError
Error returned by filesystem-provider registration, selection, and creation.

Type Aliases§

AsyncFileSystemProvider
Metadata-bearing asynchronous filesystem provider trait object type.
FileSystemProvider
Self-described filesystem provider trait object type.
FileSystemRegistryResult
Result returned by filesystem registry operations.