Trait symphonia_core::io::MediaSource
source · pub trait MediaSource: Read + Seek + Send + Sync {
// Required methods
fn is_seekable(&self) -> bool;
fn byte_len(&self) -> Option<u64>;
}
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§
sourcefn is_seekable(&self) -> bool
fn is_seekable(&self) -> bool
Returns if the source is seekable. This may be an expensive operation.
Implementations on Foreign Types§
source§impl MediaSource for File
impl MediaSource for File
source§fn is_seekable(&self) -> bool
fn is_seekable(&self) -> bool
Returns if the std::io::File
backing the MediaSource
is seekable.
Note: This operation involves querying the underlying file descriptor for information and may be moderately expensive. Therefore it is recommended to cache this value if used often.