Trait toad::ToCoapValue

source ·
pub trait ToCoapValue {
    // Required method
    fn to_coap_value<T: Array<Item = u8>>(self) -> T;
}
Expand description

Something that can be stored in a CoAP Option.

These include:

  • strings (str and String)
  • empty (())
  • unsigned integers (u8, u16, u32, u64)
  • bytes (anything that impls [toad_common::Array])

Required Methods§

source

fn to_coap_value<T: Array<Item = u8>>(self) -> T

Convert the value

Implementations on Foreign Types§

source§

impl ToCoapValue for &[u8]

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl ToCoapValue for u16

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl ToCoapValue for Bytes<'_>

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl ToCoapValue for u8

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl<A: Array<Item = u8>> ToCoapValue for ArrayVec<A>

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl ToCoapValue for u64

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl ToCoapValue for u32

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

source§

impl<'a> ToCoapValue for &'a str

source§

fn to_coap_value<T: Array<Item = u8>>(self) -> T

Implementors§