pub trait IsoBox: IsoSized {
const TYPE: BoxType;
// Provided methods
fn add_header_size(payload_size: usize) -> usize { ... }
fn box_header(&self) -> BoxHeader { ... }
fn serialize_box_header<W>(&self, writer: W) -> Result<()>
where W: Write { ... }
}Expand description
This trait should be implemented by all box types.
Required Associated Constants§
Provided Methods§
Sourcefn add_header_size(payload_size: usize) -> usize
fn add_header_size(payload_size: usize) -> usize
This function calculates the header size, adds it to the given payload size and return the result.
This can be used as a helper function when implementing the IsoSized trait.
Sourcefn box_header(&self) -> BoxHeader
fn box_header(&self) -> BoxHeader
Constructs a BoxHeader for this box.
Sourcefn serialize_box_header<W>(&self, writer: W) -> Result<()>where
W: Write,
fn serialize_box_header<W>(&self, writer: W) -> Result<()>where
W: Write,
Serializes the box header returned by IsoBox::box_header to the given writer.
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.