Skip to main content

SegmentProvider

Trait SegmentProvider 

Source
pub trait SegmentProvider: Send + Sync {
    // Required method
    fn segments(&self) -> Vec<(SegmentSeq, Bytes)>;
}
Available on crate feature std only.
Expand description

The segments the origin should describe, given the Trunk it reads.

A Trunk holds the media; which published segments a program presents is the host’s own bookkeeping — the same source multimux renders its DASH window from — so the origin asks for it rather than inferring it. A presence check with no store of its own is the plain adapter.

Required Methods§

Source

fn segments(&self) -> Vec<(SegmentSeq, Bytes)>

The program’s published (sequence number, bytes) pairs, oldest first. The bytes are shared handles: a provider hands out the segment it already holds, never a copy.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> SegmentProvider for F
where F: Fn() -> Vec<(SegmentSeq, Bytes)> + Send + Sync,