[][src]Struct libcoap_sys::coap_pdu_t

#[repr(C)]
pub struct coap_pdu_t {
    pub type_: u8,
    pub code: u8,
    pub max_hdr_size: u8,
    pub hdr_size: u8,
    pub token_length: u8,
    pub tid: u16,
    pub max_delta: u16,
    pub alloc_size: usize,
    pub used_size: usize,
    pub max_size: usize,
    pub token: *mut u8,
    pub data: *mut u8,
}

structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload marker (0xff), then the payload if stored inline. Memory layout is: <---header--->|<---token---><---options--->0xff<---payload---> header is addressed with a negative offset to token, its maximum size is max_hdr_size. options starts at token + token_length payload starts at data, its length is used_size - (data - token)

Fields

type_: u8

< message type

code: u8

< request method (value 1--10) or response code (value 40-255)

max_hdr_size: u8

< space reserved for protocol-specific header

hdr_size: u8

< actaul size used for protocol-specific header

token_length: u8

< length of Token

tid: u16

< transaction id, if any, in regular host byte order

max_delta: u16

< highest option number

alloc_size: usize

< allocated storage for token, options and payload

used_size: usize

< used bytes of storage for token, options and payload

max_size: usize

< maximum size for token, options and payload, or zero for variable size pdu

token: *mut u8

< first byte of token, if any, or options

data: *mut u8

< first byte of payload, if any

Trait Implementations

impl Clone for coap_pdu_t[src]

impl Copy for coap_pdu_t[src]

impl Debug for coap_pdu_t[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.