pub trait Ux: Sealed + Copy + Clone {
    type Bytes: AsRef<[u8]> + Default + AsMut<[u8]>;

    fn to_be_bytes(self) -> Self::Bytes;
    fn from_be_bytes(bytes: Self::Bytes) -> Self;
}
Expand description

Trait for any integer type that can be converted to a number of octets in network byte order for CoAP.

These are used to back the crate::MinimalWritableMessage::add_option_uint functions.

Implemented as a sealed trait over u8, u16, u32 and u64 to be later moved to num_traits::PrimInt if https://github.com/rust-num/num-traits/issues/189 works out, or a similar generic trait.

Required Associated Types

Index is used to get a slice out of it, Default and IndexMut in value_uint. Given it’s sealed, this can easily be extended if the add_option_uint or value_uint implementations chanage.

Required Methods

Implementations on Foreign Types

Implementors