pub struct FrameHeader {
pub pixel_format: PixelFormat,
pub width: u32,
pub height: u32,
pub seq: u32,
}Expand description
16-byte binary frame header prepended to every image payload.
See module-level documentation for the byte layout and format discriminant table.
Fields§
§pixel_format: PixelFormatPixel format of the following pixel data.
width: u32Image width in pixels.
height: u32Image height in pixels.
seq: u32Monotonically increasing frame sequence number (wraps at u32::MAX).
Implementations§
Source§impl FrameHeader
impl FrameHeader
Sourcepub fn decode(buf: &[u8]) -> Result<(FrameHeader, &[u8]), FrameHeaderError>
pub fn decode(buf: &[u8]) -> Result<(FrameHeader, &[u8]), FrameHeaderError>
Decode a header from the front of buf.
On success returns (header, pixel_data_slice) where pixel_data_slice
is the remaining bytes after the 16-byte header.
Trait Implementations§
Source§impl Clone for FrameHeader
impl Clone for FrameHeader
Source§fn clone(&self) -> FrameHeader
fn clone(&self) -> FrameHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameHeader
impl Debug for FrameHeader
Source§impl PartialEq for FrameHeader
impl PartialEq for FrameHeader
Source§fn eq(&self, other: &FrameHeader) -> bool
fn eq(&self, other: &FrameHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FrameHeader
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnsafeUnpin for FrameHeader
impl UnwindSafe for FrameHeader
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