Trait coap_message::ReadableMessage
source · 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§
sourcetype Code: Code
type Code: Code
See Self::code()
sourcetype MessageOption<'a>: MessageOption
where
Self: 'a
type MessageOption<'a>: MessageOption where Self: 'a
Type of an individual option, indiciating its option number and value
sourcetype OptionsIter<'a>: Iterator<Item = Self::MessageOption<'a>>
where
Self: 'a
type OptionsIter<'a>: Iterator<Item = Self::MessageOption<'a>> where Self: 'a
See Self::options()
Required Methods§
sourcefn code(&self) -> Self::Code
fn code(&self) -> Self::Code
Get the code (request method or response code) of the message
See Code for its details.
sourcefn options(&self) -> Self::OptionsIter<'_>
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.
Object Safety§
This trait is not object safe.