WireHeader

Struct WireHeader 

Source
pub struct WireHeader<T: ImmutableData> { /* private fields */ }
Expand description

Header generic over arbitrary storage for wire encoding

Implementations§

Source§

impl<T: ImmutableData> WireHeader<T>

Source

pub fn new(buff: T) -> Self

Create a new header object

Source

pub fn protocol_version(&self) -> u16

Source

pub fn application_id(&self) -> u16

Source

pub fn kind(&self) -> Kind

Source

pub fn flags(&self) -> Flags

Source

pub fn index(&self) -> u16

Source

pub fn data_len(&self) -> usize

Source

pub fn private_options_len(&self) -> usize

Source

pub fn public_options_len(&self) -> usize

Source§

impl<T: MutableData> WireHeader<T>

Source

pub fn encode(&mut self, h: &Header)

Write a base::Header

Source

pub fn set_protocol_version(&mut self, version: u16)

Set the protocol version

Source

pub fn set_application_id(&mut self, application_id: u16)

Set the application ID

Source

pub fn set_flags(&mut self, flags: Flags)

Set object flags

Source

pub fn set_kind(&mut self, kind: Kind)

Set the object kind

Source

pub fn set_index(&mut self, index: u16)

Set object index

Source

pub fn set_data_len(&mut self, data_len: usize)

Set the body field length

Source

pub fn set_private_options_len(&mut self, private_options_len: usize)

Set the private options field length

Source

pub fn set_public_options_len(&mut self, public_options_len: usize)

Set the public options field length

Trait Implementations§

Source§

impl<T: ImmutableData> From<&WireHeader<T>> for Header

Source§

fn from(wh: &WireHeader<T>) -> Header

Build a base::Header object from a WireHeader

Auto Trait Implementations§

§

impl<T> Freeze for WireHeader<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for WireHeader<T>
where T: RefUnwindSafe,

§

impl<T> Send for WireHeader<T>
where T: Send,

§

impl<T> Sync for WireHeader<T>
where T: Sync,

§

impl<T> Unpin for WireHeader<T>
where T: Unpin,

§

impl<T> UnwindSafe for WireHeader<T>
where T: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.