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: TagTypeTagType byte (§E.4.1).
data_size: u32DataSize (§E.4.1): the body length that follows the header.
timestamp: u32Millisecond timestamp: the UI24 Timestamp plus the UI8
TimestampExtended as its top byte (§E.4.1).
stream_id: u32StreamID (§E.4.1).
Implementations§
Source§impl FlvTagHeader
impl FlvTagHeader
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, RtmpError>
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.
Trait Implementations§
Source§impl Clone for FlvTagHeader
impl Clone for FlvTagHeader
impl Copy for FlvTagHeader
Source§impl Debug for FlvTagHeader
impl Debug for FlvTagHeader
impl Eq for FlvTagHeader
Source§impl PartialEq for FlvTagHeader
impl PartialEq for FlvTagHeader
Source§impl Serialize for FlvTagHeader
impl Serialize for FlvTagHeader
Source§type Error = RtmpError
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
fn serialized_len(&self) -> usize
Number of bytes
serialize_into will write.Source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize, RtmpError>
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>
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).impl StructuralPartialEq for FlvTagHeader
Auto Trait Implementations§
impl Forget for FlvTagHeader
impl Freeze for FlvTagHeader
impl Move for FlvTagHeader
impl RefUnwindSafe for FlvTagHeader
impl Send for FlvTagHeader
impl Sync for FlvTagHeader
impl Unpin for FlvTagHeader
impl UnsafeUnpin for FlvTagHeader
impl UnwindSafe for FlvTagHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more