Skip to main content

FileSystemProperties

Struct FileSystemProperties 

Source
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

Source

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.

Source

pub const fn info(&self) -> &FileSystemInfo

Returns the stable filesystem identity and configuration.

§Returns

The immutable provider information snapshot.

Source

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.

Source

pub const fn limits(&self) -> &FileSystemLimits

Returns the stable filesystem limits.

§Returns

The immutable provider limit snapshot.

Source

pub const fn path_constraints(&self) -> &PathConstraints

Returns the immutable accepted path constraints.

§Returns

The accepted logical path forms.

Returns the provider-declared symbolic-link traversal policy.

Source

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

Source§

fn clone(&self) -> FileSystemProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FileSystemProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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<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.