pub struct FileSystemProperties { /* private fields */ }Expand description
Immutable construction-time properties cached by a filesystem facade.
A facade exposes the provider’s validated identity, limits, path rules, and effective capabilities through one stable snapshot. The capability set may include facts derived by the facade; it is therefore not necessarily a byte-for-byte copy of the provider declaration.
§Examples
use qubit_fs::metadata::{FileSystemCapabilities, FileSystemId, FileSystemInfo,
FileSystemLimit, FileSystemLimits, SymlinkPolicy};
use qubit_fs::path::{PathConstraints, PathForm, PathSemantics};
use qubit_fs::metadata::FileSystemProperties;
let properties = FileSystemProperties::new(
FileSystemInfo::new(FileSystemId::new("example")?, "example", PathSemantics::Hierarchical),
FileSystemCapabilities::new(),
FileSystemLimits::unknown().with_max_path_text_bytes(FileSystemLimit::Maximum(4096)),
PathConstraints::absolute(),
SymlinkPolicy::Reject,
)?;
assert_eq!(properties.info().provider_id(), "example");
assert_eq!(properties.limits().max_path_text_bytes(), FileSystemLimit::Maximum(4096));
assert_eq!(properties.path_constraints().form(), PathForm::Absolute);Implementations§
Source§impl FileSystemProperties
impl FileSystemProperties
Sourcepub fn new(
info: FileSystemInfo,
capabilities: FileSystemCapabilities,
limits: FileSystemLimits,
path_constraints: PathConstraints,
symlink_policy: SymlinkPolicy,
) -> FsResult<Self>
pub fn new( info: FileSystemInfo, capabilities: FileSystemCapabilities, limits: FileSystemLimits, path_constraints: PathConstraints, symlink_policy: SymlinkPolicy, ) -> FsResult<Self>
Builds and validates an immutable filesystem property snapshot.
This method performs no I/O.
§Parameters
info: Stable provider identity and path semantics.capabilities: Capabilities explicitly advertised by the provider.limits: Provider resource and operation limits.path_constraints: Accepted absolute and relative path forms.symlink_policy: Provider-declared symbolic-link traversal policy.
§Returns
A validated immutable property snapshot.
§Errors
Returns an invalid-options error when the provider identity is invalid, advertised capabilities violate dependencies, or path configuration is internally inconsistent.
Sourcepub const fn info(&self) -> &FileSystemInfo
pub const fn info(&self) -> &FileSystemInfo
Returns the stable filesystem identity and configuration.
§Returns
The immutable provider information snapshot.
Sourcepub const fn capabilities(&self) -> FileSystemCapabilities
pub const fn capabilities(&self) -> FileSystemCapabilities
Returns the effective application-visible capabilities.
The snapshot contains provider-declared capabilities plus capabilities derived by the facade, such as conditional streamed copy support.
§Returns
Capabilities available to callers of the facade.
Sourcepub const fn limits(&self) -> &FileSystemLimits
pub const fn limits(&self) -> &FileSystemLimits
Sourcepub const fn path_constraints(&self) -> &PathConstraints
pub const fn path_constraints(&self) -> &PathConstraints
Sourcepub const fn symlink_policy(&self) -> SymlinkPolicy
pub const fn symlink_policy(&self) -> SymlinkPolicy
Returns the provider-declared symbolic-link traversal policy.
Sourcepub fn validate_path(&self, path: &Path, operation: FsOperation) -> FsResult<()>
pub fn validate_path(&self, path: &Path, operation: FsOperation) -> FsResult<()>
Validates a logical path against the provider’s semantics, form, and byte limits without performing I/O.
§Errors
Returns an enriched invalid-path or resource-limit error when the path does not satisfy this filesystem’s declared contract.
Trait Implementations§
Source§impl Clone for FileSystemProperties
impl Clone for FileSystemProperties
Source§fn clone(&self) -> FileSystemProperties
fn clone(&self) -> FileSystemProperties
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more