Struct NullMessageWrite

Source
pub struct NullMessageWrite;
Expand description

Null message writer. Anything written to this instance will be ignored.

Trait Implementations§

Source§

impl Debug for NullMessageWrite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MessageWrite for NullMessageWrite

Source§

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)

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)

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)

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>

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 clear(&mut self)

Removes the message payload along with all options.
Source§

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>

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>

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

Source§

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>

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>

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>

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<O> OptionInsertExt for O
where O: OptionInsert + ?Sized,

Source§

fn insert_option<'a, T>( &mut self, key: OptionKey<T>, value: T, ) -> Result<(), Error>
where T: Into<OptionValue<'a>>,

Inserts an option into the message with a value of the appropriate type. Calling this method with out-of-order keys will incur a significant performance penalty.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V