pub trait Context<T: Type + ?Sized> {
    type Data: PointerWrapper + Send + Sync + 'static;

    const USE_VTABLE_ATTR: ();
    const HAS_TRY_NEW: bool = false;
    const HAS_PARSE_UNKNOWN_PARAM: bool = false;
    const HAS_PARSE_MONOLITHIC: bool = false;
    const HAS_TREE_KEY: bool = false;
    const PARAMS: SpecTable<'static, Self::Data> = param::SpecTable::empty();

    fn try_new() -> Result<Self::Data>;

    fn parse_unknown_param(
        _data: &mut Self::Data,
        _name: &CStr,
        _value: Value<'_>
    ) -> Result { ... } fn parse_monolithic<'a>(
        _data: &mut Self::Data,
        _buf: Option<&'a mut [u8]>
    ) -> Result<Option<&'a mut [u8]>> { ... } fn tree_key(_data: &mut Self::Data) -> Result<T::Data> { ... } }
Expand description

A file system context.

It is used to gather configuration to then mount or reconfigure a file system.

Required Associated Types

Type of the data associated with the context.

Required Associated Constants

A marker to prevent implementors from forgetting to use #[vtable] attribute when implementing this trait.

Provided Associated Constants

Indicates if the try_new method is overridden by the implementor.

Indicates if the parse_unknown_param method is overridden by the implementor.

Indicates if the parse_monolithic method is overridden by the implementor.

Indicates if the tree_key method is overridden by the implementor.

The typed file system parameters.

Users are encouraged to define it using the crate::define_fs_params macro.

Required Methods

Creates a new context.

Provided Methods

Parses a parameter that wasn’t specified in Self::PARAMS.

Parses the whole parameter block, potentially skipping regular handling for parts of it.

The return value is the portion of the input buffer for which the regular handling (involving Self::PARAMS and Self::parse_unknown_param) will still be carried out. If it’s None, the regular handling is not performed at all.

Returns the superblock data to be used by this file system context.

This is only needed when Type::SUPER_TYPE is Super::Keyed, otherwise it is never called. In the former case, when the fs is being mounted, an existing superblock is reused if one can be found with the same data as the returned value; otherwise a new superblock is created.

Implementors