Skip to main content

Decoder

Trait Decoder 

Source
pub trait Decoder {
    // Required method
    fn decode(data: &[u8]) -> RoxResult<RoxChart>;

    // Provided method
    fn decode_from_path(path: impl AsRef<Path>) -> RoxResult<RoxChart> { ... }
}
Expand description

Trait for decoding from external formats to ROX.

Required Methods§

Source

fn decode(data: &[u8]) -> RoxResult<RoxChart>

Decode a chart from raw bytes.

§Errors

Returns an error if the data is invalid or cannot be parsed.

Provided Methods§

Source

fn decode_from_path(path: impl AsRef<Path>) -> RoxResult<RoxChart>

Decode a chart from a file path.

§Errors

Returns an error if the file cannot be read or contains invalid data.

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§