Skip to main content

SourceOpener

Trait SourceOpener 

Source
pub trait SourceOpener: Send + Sync {
    // Required methods
    fn reads(&self, path: &Path) -> bool;
    fn sources(&self, path: &Path) -> DspResult<Vec<SourceEntry>>;
    fn open(&self, path: &Path, id: &str) -> DspResult<Box<dyn RecordingSource>>;

    // Provided method
    fn layout(&self, _path: &Path, _id: &str) -> Option<ChannelLayout> { ... }
}
Expand description

Opens the files of a domain’s formats.

Required Methods§

Source

fn reads(&self, path: &Path) -> bool

Whether path is one of its formats (cheap: the name or a header).

Source

fn sources(&self, path: &Path) -> DspResult<Vec<SourceEntry>>

Source

fn open(&self, path: &Path, id: &str) -> DspResult<Box<dyn RecordingSource>>

Provided Methods§

Source

fn layout(&self, _path: &Path, _id: &str) -> Option<ChannelLayout>

The channel layout of source id of path, when the file stores one.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§