Skip to main content

FileMedia

Trait FileMedia 

Source
pub trait FileMedia: Send + Sync {
    // Required methods
    fn length(&self) -> u64;
    fn name(&self) -> &str;
    fn read_range(
        &self,
        interval: ReadInterval,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + '_>>;
}
Available on crate feature async only.
Expand description

Abstract file source that can provide byte ranges asynchronously.

Implement this trait for custom byte sources (e.g., HTTP range requests). The library provides LocalFileMedia for local files.

Required Methods§

Source

fn length(&self) -> u64

Source

fn name(&self) -> &str

Source

fn read_range( &self, interval: ReadInterval, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + '_>>

Implementors§