pub struct Header {
pub width: u16,
pub height: u16,
pub fps: u16,
}Expand description
The 12-byte header a socket client sends before its first frame.
RXP and a zero byte, version 1, one reserved byte, then width, height and fps as
little-endian u16.
Fields§
§width: u16§height: u16§fps: u16Implementations§
Source§impl Header
impl Header
pub const LEN: usize = 12
pub fn to_bytes(self) -> [u8; 12]
Sourcepub fn from_bytes(b: &[u8; 12]) -> Result<Self>
pub fn from_bytes(b: &[u8; 12]) -> Result<Self>
§Errors
InvalidData on a wrong magic or version, InvalidInput on a zero size.
Trait Implementations§
impl Copy for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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