Skip to main content

FlvTagHeader

Struct FlvTagHeader 

Source
pub struct FlvTagHeader {
    pub tag_type: TagType,
    pub data_size: u32,
    pub timestamp: u32,
    pub stream_id: u32,
}
Expand description

The 11-byte tag header of a tag whose body may not have arrived yet (§E.4.1): TagType, DataSize, Timestamp + TimestampExtended and StreamID, without the body — what an incremental reader needs to know how many bytes the whole tag takes before it can decode one.

FlvTag::parse and the tolerant walk both read the header through here.

Fields§

§tag_type: TagType

TagType byte (§E.4.1).

§data_size: u32

DataSize (§E.4.1): the body length that follows the header.

§timestamp: u32

Millisecond timestamp: the UI24 Timestamp plus the UI8 TimestampExtended as its top byte (§E.4.1).

§stream_id: u32

StreamID (§E.4.1).

Implementations§

Source§

impl FlvTagHeader

Source

pub fn parse(bytes: &[u8]) -> Result<Self, RtmpError>

The header of the tag starting at the front of bytes.

§Errors

RtmpError::BufferTooShort when fewer than FLV_TAG_HEADER_LEN bytes are present.

Source

pub fn total_len(&self) -> usize

Bytes of the whole tag this header announces: header, body and the trailing PreviousTagSize (§E.4.1).

Trait Implementations§

Source§

impl Clone for FlvTagHeader

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FlvTagHeader

Source§

impl Debug for FlvTagHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FlvTagHeader

Source§

impl PartialEq for FlvTagHeader

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FlvTagHeader

Source§

type Error = RtmpError

The error type this implementer returns (usually the same as the corresponding Parse impl, but need not be).
Source§

fn serialized_len(&self) -> usize

Number of bytes serialize_into will write.
Source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize, RtmpError>

Write the serialised form into buf. Returns the number of bytes written (always equal to serialized_len()).
Source§

fn try_to_bytes(&self) -> Result<Vec<u8>, Self::Error>

Allocate a Vec and serialize into it, returning the serializer’s error instead of panicking. This is the only allocate-and-serialize entry point: there is deliberately no panicking to_bytes (hand-built values, or values assembled from damaged wire data, can violate a wire constraint, so the error must reach the caller).
Source§

impl StructuralPartialEq for FlvTagHeader

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.