Skip to main content

SourceOpen

Trait SourceOpen 

Source
pub trait SourceOpen {
    // Required method
    fn open(
        &self,
        source: DynSource,
        spec: PathSpec,
        depth: usize,
    ) -> VfsResult<Option<Resolved>>;
}
Expand description

The generic layer resolver, exposed as an extension trait on the leaf’s Openers. Bring it into scope (use forensic_vfs_resolver::SourceOpen;) to call openers.open(source, spec, 0).

Required Methods§

Source

fn open( &self, source: DynSource, spec: PathSpec, depth: usize, ) -> VfsResult<Option<Resolved>>

Recursively resolve a source to a filesystem: sniff its head (and a tail window for trailer magics); if a filesystem prober recognizes it, mount it; otherwise if a volume-system prober recognizes it, descend into each volume and resolve that; otherwise if a container decoder recognizes it, decode and resolve the decoded stream. Ok(None) when nothing recognizes it — a genuinely clean unknown, not an error. A prober’s open failure after a positive verdict propagates loud (never a silent None).

depth is the current nesting level; callers start at 0. The recursion is depth-capped against a self-referential container/volume bomb.

§Errors

Propagates a source read error, or a prober open/decode failure raised after a positive probe verdict.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SourceOpen for Openers

Source§

fn open( &self, source: DynSource, spec: PathSpec, depth: usize, ) -> VfsResult<Option<Resolved>>

Implementors§