Trait BoxType

Source
pub trait BoxType {
    const NAME: [u8; 4];

    // Required methods
    fn demux(header: BoxHeader, data: Bytes) -> Result<Self>
       where Self: Sized;
    fn primitive_size(&self) -> u64;
    fn primitive_mux<T: Write>(&self, writer: &mut T) -> Result<()>;

    // Provided methods
    fn mux<T: Write>(&self, writer: &mut T) -> Result<()> { ... }
    fn size(&self) -> u64 { ... }
    fn validate(&self) -> Result<()> { ... }
}

Required Associated Constants§

Source

const NAME: [u8; 4]

Required Methods§

Source

fn demux(header: BoxHeader, data: Bytes) -> Result<Self>
where Self: Sized,

Parse a box from a byte stream. The basic header is already parsed.

Source

fn primitive_size(&self) -> u64

The size of the box without the basic header.

Source

fn primitive_mux<T: Write>(&self, writer: &mut T) -> Result<()>

Write the box to a byte stream. The basic header is already written.

Provided Methods§

Source

fn mux<T: Write>(&self, writer: &mut T) -> Result<()>

Write the box to a byte stream.

Source

fn size(&self) -> u64

Size of the box including the basic header.

Source

fn validate(&self) -> Result<()>

Validate the box.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BoxType for Av01

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Av1C

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Avc1

Source§

const NAME: [u8; 4]

Source§

impl BoxType for AvcC

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Btrt

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Clap

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Co64

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Colr

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Ctts

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Dinf

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Dref

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Edts

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Elst

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Esds

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Ftyp

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Hdlr

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Hev1

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Hmhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for HvcC

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mdat

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mdhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mdia

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mehd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mfhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Minf

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Moof

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Moov

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mp4a

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mvex

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Mvhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Nmhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Opus

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Padb

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Pasp

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Sbgp

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Sdtp

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Smhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stbl

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stco

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stdp

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stsc

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stsd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stsh

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stss

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stsz

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stts

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Stz2

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Subs

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Tfdt

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Tfhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Tkhd

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Traf

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Trak

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Trex

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Trun

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Url

Source§

const NAME: [u8; 4]

Source§

impl BoxType for Vmhd

Source§

const NAME: [u8; 4]