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

Trait MediaSource

pub trait MediaSource:
    Read
    + Seek
    + Send
    + Sync {
    // Required methods
    fn is_seekable(&self) -> bool;
    fn byte_len(&self) -> Option<u64> ;
}
Available on crate feature dep_symphonia only.
Expand description

MediaSource is a composite trait of std::io::Read and std::io::Seek. A source must implement this trait to be used by MediaSourceStream.

Despite requiring the std::io::Seek trait, seeking is an optional capability that can be queried at runtime.

Required Methods§

fn is_seekable(&self) -> bool

Returns if the source is seekable. This may be an expensive operation.

fn byte_len(&self) -> Option<u64>

Returns the length in bytes, if available. This may be an expensive operation.

Implementors§

§

impl MediaSource for File

§

impl MediaSource for MediaSourceStream

§

impl<R> MediaSource for ReadOnlySource<R>
where R: Read + Send + Sync,

§

impl<T> MediaSource for Cursor<T>
where T: AsRef<[u8]> + Send + Sync,