[−][src]Trait async_coap::message::MessageRead
Trait for reading the various parts of a CoAP message.
Required methods
fn msg_code(&self) -> MsgCode
Gets the message code for this message.
fn msg_type(&self) -> MsgType
Gets the message type for this message.
fn msg_id(&self) -> MsgId
Gets the message id for this message.
fn msg_token(&self) -> MsgToken
Gets the message token for this message.
fn payload(&self) -> &[u8]
Gets the payload as a byte slice.
ⓘImportant traits for OptionIterator<'a>fn options(&self) -> OptionIterator
Gets an iterator for processing the options of the message.
fn content_format(&self) -> Option<ContentFormat>
Indicates the content format of the payload, if specified.
fn accept(&self) -> Option<ContentFormat>
Indicates the content format that the sender of the message will accept for the payload of the response, if specified.
fn block2(&self) -> Option<BlockInfo>
Returns the value of the block2
option for this message, if any.
fn block1(&self) -> Option<BlockInfo>
Returns the value of the block1
option for this message, if any.
Provided methods
fn write_msg_to(&self, target: &mut dyn MessageWrite) -> Result<(), Error>
Writes this message to the given target
that implements MessageWrite
.
If this message has a message id (msg_id
) of zero, the message
id will not be written to target
.
fn payload_as_str(&self) -> Option<&str>
Gets the payload as a string slice.
Trait Implementations
impl<'a> ToOwned for dyn MessageRead + 'a
[src]
type Owned = OwnedImmutableMessage
The resulting type after obtaining ownership.
fn to_owned(&self) -> Self::Owned
[src]
fn clone_into(&self, target: &mut Self::Owned)
[src]
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more