Skip to main content

SemanticSceneLoader

Trait SemanticSceneLoader 

Source
pub trait SemanticSceneLoader {
    type Options: Default;
    type Error;

    // Required method
    fn from_reader<R: BufRead>(
        reader: R,
        options: Self::Options,
    ) -> Result<SemanticScene, Self::Error>;

    // Provided methods
    fn from_str(
        input: &str,
        options: Self::Options,
    ) -> Result<SemanticScene, Self::Error> { ... }
    fn from_path(
        path: impl AsRef<Path>,
        options: Self::Options,
    ) -> Result<SemanticScene, Self::Error>
       where Self::Error: From<Error> { ... }
}
Expand description

Trait implemented by semantic scene descriptor loaders.

from_reader is the required primitive so loaders can work with files, in-memory buffers, compressed streams, and test fixtures. from_str and from_path are convenience methods implemented in terms of it.

Required Associated Types§

Source

type Options: Default

Loader-specific options.

Source

type Error

Loader-specific error type.

Required Methods§

Source

fn from_reader<R: BufRead>( reader: R, options: Self::Options, ) -> Result<SemanticScene, Self::Error>

Loads a semantic scene from any buffered reader.

§Errors

Returns loader-specific errors for I/O, parse, and validation failures.

Provided Methods§

Source

fn from_str( input: &str, options: Self::Options, ) -> Result<SemanticScene, Self::Error>

Loads a semantic scene from an in-memory string.

§Errors

Returns loader-specific parse and validation failures.

Source

fn from_path( path: impl AsRef<Path>, options: Self::Options, ) -> Result<SemanticScene, Self::Error>
where Self::Error: From<Error>,

Loads a semantic scene from a path.

§Errors

Returns I/O errors from opening the file or loader-specific parse and validation failures.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§