pub trait OptionInsert {
// Required method
fn insert_option_with_bytes(
&mut self,
key: OptionNumber,
value: &[u8],
) -> Result<(), Error>;
// Provided methods
fn insert_option_empty(&mut self, key: OptionNumber) -> Result<(), Error> { ... }
fn insert_option_with_str(
&mut self,
key: OptionNumber,
value: &str,
) -> Result<(), Error> { ... }
fn insert_option_with_u32(
&mut self,
key: OptionNumber,
value: u32,
) -> Result<(), Error> { ... }
}
Expand description
Trait for types that allow you to insert CoAP options into them.
Required Methods§
Sourcefn 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.
Provided Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.