[−][src]Trait coap_message::MinimalWritableMessage
A message that needs to have its code, any options in ascending order and its payload set in that very sequence.
This is the bare minimum a message needs to provide to be populated as a request or response by a generic program; it is up to the program to ensure the valid sequence of operations, as failure to do so may incur panics (FIXME: or errors).
Associated Types
type Code: Code
type OptionNumber: OptionNumber
Required methods
fn set_code(&mut self, code: Self::Code)
fn add_option(&mut self, number: Self::OptionNumber, value: &[u8])
fn set_payload(&mut self, data: &[u8])
Provided methods
fn set_from_message<M>(&mut self, msg: &M) where
M: ReadableMessage + for<'a> OptionsSortedIterableMessage<'a>,
M: ReadableMessage + for<'a> OptionsSortedIterableMessage<'a>,
Copy code, options and payload in from a readable message
Implementations can override this for cases where it can be done more efficiently than iterating over the options and appending them.