pub trait ReadableMessage {
    type Code: Code;
    type MessageOption<'a>: MessageOption
       where Self: 'a;
    type OptionsIter<'a>: Iterator<Item = Self::MessageOption<'a>>
       where Self: 'a;

    // Required methods
    fn code(&self) -> Self::Code;
    fn options(&self) -> Self::OptionsIter<'_>;
    fn payload(&self) -> &[u8];
}
Expand description

A CoAP message whose code, options and payload can be read

Required Associated Types§

source

type Code: Code

source

type MessageOption<'a>: MessageOption where Self: 'a

Type of an individual option, indiciating its option number and value

source

type OptionsIter<'a>: Iterator<Item = Self::MessageOption<'a>> where Self: 'a

Required Methods§

source

fn code(&self) -> Self::Code

Get the code (request method or response code) of the message

See Code for its details.

source

fn options(&self) -> Self::OptionsIter<'_>

Produce all options in arbitrary order as an iterator

They are sorted if the WithSortedOptions is implemented as well; implementers should set that trait whenever they can.

source

fn payload(&self) -> &[u8]

Get the payload set in the message

This is necessarily empty for messages of some codes.

Object Safety§

This trait is not object safe.

Implementors§