devela::_dep::symphonia::core::io::vlc

Trait CodebookEntry

pub trait CodebookEntry:
    Copy
    + Clone
    + Default {
    type ValueType: Copy + From<u8>;
    type OffsetType: Copy;

    const JUMP_OFFSET_MAX: u32;

    // Required methods
    fn new_value(value: Self::ValueType, len: u8) -> Self;
    fn new_jump(offset: u32, len: u8) -> Self;
    fn is_value(&self) -> bool;
    fn is_jump(&self) -> bool;
    fn value(&self) -> Self::ValueType;
    fn value_len(&self) -> u32 ;
    fn jump_offset(&self) -> usize ;
    fn jump_len(&self) -> u32 ;
}
Available on crate feature dep_symphonia only.
Expand description

CodebookEntry provides the functions required for an entry in the Codebook.

Required Associated Constants§

const JUMP_OFFSET_MAX: u32

The maximum jump offset.

Required Associated Types§

type ValueType: Copy + From<u8>

The type of a value in this entry.

type OffsetType: Copy

The type of a jump offset in this entry.

Required Methods§

fn new_value(value: Self::ValueType, len: u8) -> Self

Creates a new value entry.

fn new_jump(offset: u32, len: u8) -> Self

Create a new jump entry.

fn is_value(&self) -> bool

Returns true if this entry is a value entry.

fn is_jump(&self) -> bool

Returns true if this entry is a jump entry.

fn value(&self) -> Self::ValueType

Gets the value.

fn value_len(&self) -> u32

Get the length of the value in bits.

fn jump_offset(&self) -> usize

Get the position in the table to jump to.

fn jump_len(&self) -> u32

Get the number of bits to read after jumping in the table.

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§