Skip to main content

Wire

Struct Wire 

Source
pub struct Wire { /* private fields */ }
Expand description

CMAF container: encodes/decodes a single track’s moof+mdat fragments.

Build from a CMAF init segment with Wire::from_init, which refuses a track that is neither audio nor video.

The parsed track is heap-allocated so that embedding Wire in other enums (e.g. catalog::hang::Wire) doesn’t bloat unrelated variants.

Implementations§

Source§

impl Wire

Source

pub fn from_init(init_data: &[u8]) -> Result<Self>

Parse a CMAF init segment (ftyp+moov), extracting the single track and its trex defaults.

Trait Implementations§

Source§

impl Container for Wire

Source§

type Error = Error

Container-specific error. Must be convertible from [moq_net::Error] (so IO errors propagate), MissingKeyframe, InvalidEnd, and TimestampRewind (so the producer can reject invalid group boundaries).
Source§

fn kind(&self) -> Kind

The media role, when this format represents an audio or video track.
Source§

fn write( &self, group: &mut Writer<'_>, frames: &[Frame], ) -> Result<(), Self::Error>

Encode one or more frames into moq-lite frames written to group, whose first frame creates it on the track.
Source§

fn decode(&self, frame: Frame) -> Result<Vec<Frame>, Self::Error>

Decode one moq-lite frame read from a group into media frames. Read more
Source§

fn end(&self, _frame: &Frame) -> Option<Timestamp>

Return the endpoint timestamp when frame carries empty-payload metadata. Read more
Source§

fn decode_order(&self) -> bool

Whether the transport carries each frame’s decode time, so a Producer groups frames by it. Otherwise the producer ignores decode times and the payload carries each frame’s presentation time.
Source§

fn writable(&self) -> Result<(), Self::Error>

Refuse a format this build can read but not write, before a producer is built for it. Read more
Source§

fn check(&self, _frame: &Frame) -> Result<(), Self::Error>

Refuse a frame this format has no encoding for, by default any frame of an unwritable format. Read more
Source§

fn finish_group( &self, _group: &mut Writer<'_>, _end: Option<Timestamp>, ) -> Result<(), Self::Error>

Write any format-specific endpoint before the producer closes the group.

Auto Trait Implementations§

§

impl Freeze for Wire

§

impl RefUnwindSafe for Wire

§

impl Send for Wire

§

impl Sync for Wire

§

impl Unpin for Wire

§

impl UnsafeUnpin for Wire

§

impl UnwindSafe for Wire

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more