Trait coap_message::ReadableMessage [−][src]
A CoAP message whose code, options and payload can be read
Associated Types
type Code: Code
[src]
See code; also used with MinimalWritableMessage::set_code()
type MessageOption: MessageOption
[src]
Type of an individual option, indiciating its option number and value
type OptionsIter: Iterator<Item = Self::MessageOption>
[src]
See options
Required methods
fn code(&self) -> Self::Code
[src]
Get the code (request method or response code) of the message
See [Code] for its meaning.
fn payload(&self) -> &[u8]
[src]
Get the payload set in the message
This is necessarily empty for messages of some codes.
fn options<'a>(&'a self) -> Self::OptionsIter
[src]
Produce all options in arbitrary order as an iterator
If your options are always produced in an ordered fashion, consider implementing the
WithSortedOptions
trait as well. This should be the case for most CoAP
message backends. Examples of backends where it is not implemented are single-pass reads
over in-place decrypted OSCORE messages.
Implementors
impl ReadableMessage for HeapMessage
[src]
type Code = u8
type MessageOption = MessageOption<'a>
type OptionsIter = ReadCursor<'a>
fn code(&self) -> u8
[src]
fn payload(&self) -> &[u8]
[src]
fn options<'m>(&'m self) -> ReadCursor<'m>ⓘNotable traits for ReadCursor<'a>
impl<'a> Iterator for ReadCursor<'a> type Item = MessageOption<'a>;
[src]
Notable traits for ReadCursor<'a>
impl<'a> Iterator for ReadCursor<'a> type Item = MessageOption<'a>;