Trait coap_message::numtraits::Ux
source · [−]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
Required Methods
source
fn to_be_bytes(self) -> Self::Bytes
source