pub struct NullMessageWrite;
Expand description
Null message writer. Anything written to this instance will be ignored.
Trait Implementations§
Source§impl Debug for NullMessageWrite
impl Debug for NullMessageWrite
Source§impl MessageWrite for NullMessageWrite
impl MessageWrite for NullMessageWrite
Source§fn set_msg_type(&mut self, _: MsgType)
fn set_msg_type(&mut self, _: MsgType)
Sets the CoAP message type. This may be called at any time during message writing
without disrupting the operation. It may be called multiple times if necessary.
The written value is that of the last call.
Source§fn set_msg_id(&mut self, _: u16)
fn set_msg_id(&mut self, _: u16)
Sets the CoAP message id. This may be called at any time during message writing
without disrupting the operation. It may be called multiple times if necessary.
The written value is that of the last call.
Source§fn set_msg_code(&mut self, _: MsgCode)
fn set_msg_code(&mut self, _: MsgCode)
Sets the CoAP message code. This may be called at any time during message writing
without disrupting the operation. It may be called multiple times if necessary.
The written value is that of the last call.
Source§fn set_msg_token(&mut self, _: MsgToken)
fn set_msg_token(&mut self, _: MsgToken)
Sets the CoAP message token. Calling this method out-of-order will cause any previously
written options or payload to be lost. It may be called multiple times if necessary.
The written value is that of the last call.
Source§fn append_payload_bytes(&mut self, _: &[u8]) -> Result<(), Error>
fn append_payload_bytes(&mut self, _: &[u8]) -> Result<(), Error>
Appends bytes from the given slice
body
to the payload of the message.
This method should only be called after the token and all options have been set.
This method may be called multiple times, each time appending data to the payload.Source§fn append_payload_string(&mut self, body: &str) -> Result<(), Error>
fn append_payload_string(&mut self, body: &str) -> Result<(), Error>
Appends bytes from the UTF8 representation of the given string slice
body
to the payload
of the message.
This method should only be called after the token and all options have been set.
This method may be called multiple times, each time appending data to the payload.Source§fn append_payload_u8(&mut self, b: u8) -> Result<(), Error>
fn append_payload_u8(&mut self, b: u8) -> Result<(), Error>
Appends a single byte to the payload of the message.
This method should only be called after the token and all options have been set.
This method may be called multiple times, each time appending data to the payload.
Source§fn append_payload_char(&mut self, c: char) -> Result<(), Error>
fn append_payload_char(&mut self, c: char) -> Result<(), Error>
Appends the UTF8 representation for a single unicode character to the payload of the
message.
This method should only be called after the token and all options have been set.
This method may be called multiple times, each time appending data to the payload.
Source§impl OptionInsert for NullMessageWrite
impl OptionInsert for NullMessageWrite
Source§fn insert_option_with_bytes(
&mut self,
_key: OptionNumber,
_value: &[u8],
) -> Result<(), Error>
fn insert_option_with_bytes( &mut self, _key: OptionNumber, _value: &[u8], ) -> Result<(), Error>
Inserts an option into the message with the given bytes as the value.
Calling this method with out-of-order keys will incur a significant performance penalty.
Source§fn insert_option_empty(&mut self, key: OptionNumber) -> Result<(), Error>
fn insert_option_empty(&mut self, key: OptionNumber) -> Result<(), Error>
Inserts an option into the message with no value.
Calling this method with out-of-order keys will incur a significant performance penalty.
Source§fn insert_option_with_str(
&mut self,
key: OptionNumber,
value: &str,
) -> Result<(), Error>
fn insert_option_with_str( &mut self, key: OptionNumber, value: &str, ) -> Result<(), Error>
Inserts an option into the message with a string value.
Calling this method with out-of-order keys will incur a significant performance penalty.
Source§fn insert_option_with_u32(
&mut self,
key: OptionNumber,
value: u32,
) -> Result<(), Error>
fn insert_option_with_u32( &mut self, key: OptionNumber, value: u32, ) -> Result<(), Error>
Inserts an option into the message with an integer value.
Calling this method with out-of-order keys will incur a significant performance penalty.
Auto Trait Implementations§
impl Freeze for NullMessageWrite
impl RefUnwindSafe for NullMessageWrite
impl Send for NullMessageWrite
impl Sync for NullMessageWrite
impl Unpin for NullMessageWrite
impl UnwindSafe for NullMessageWrite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more