Skip to main content

MediaSource

Trait MediaSource 

Source
pub trait MediaSource: Send + Sync {
    // Required methods
    fn len(&self) -> u64;
    fn mime(&self) -> &str;
    fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Bytes a media view reads, wherever they live.

Required Methods§

Source

fn len(&self) -> u64

Source

fn mime(&self) -> &str

Source

fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>

Fill buf from offset. Fewer bytes only at the end, none past it.

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§