[][src]Struct coap_lite::Header

pub struct Header {
    pub code: MessageClass,
    pub message_id: u16,
    // some fields omitted
}

The message header.

Fields

code: MessageClassmessage_id: u16

Methods

impl Header[src]

pub fn new() -> Header[src]

Creates a new header.

pub fn from_raw(raw: &HeaderRaw) -> Header[src]

Creates a new header from a raw header.

pub fn to_raw(&self) -> HeaderRaw[src]

Returns the raw header.

pub fn set_version(&mut self, v: u8)[src]

Sets the version.

pub fn get_version(&self) -> u8[src]

Returns the version.

pub fn set_type(&mut self, t: MessageType)[src]

Sets the message type.

pub fn get_type(&self) -> MessageType[src]

Returns the message type.

pub fn set_token_length(&mut self, tkl: u8)[src]

Sets the token length.

pub fn get_token_length(&self) -> u8[src]

Returns the token length.

pub fn set_code(&mut self, code: &str)[src]

Sets the message code from a string.

pub fn get_code(&self) -> String[src]

Returns the message code as a string.

Trait Implementations

impl Default for Header[src]

impl Clone for Header[src]

impl Debug for Header[src]

Auto Trait Implementations

impl Send for Header

impl Unpin for Header

impl Sync for Header

impl UnwindSafe for Header

impl RefUnwindSafe for Header

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]