pub struct OptValue<C>(pub C);
Expand description
Option Value Formats
generated from RFC7252 section 3.2
The options defined in this document make use of the following option value formats.
empty: A zero-length sequence of bytes.
opaque: An opaque sequence of bytes.
uint: A non-negative integer that is represented in network byte order using the number of bytes given by the Option Length field.
An option definition may specify a range of permissible numbers of bytes; if it has a choice, a sender SHOULD represent the integer with as few bytes as possible, i.e., without leading zero bytes. For example, the number 0 is represented with an empty option value (a zero-length sequence of bytes) and the number 1 by a single byte with the numerical value of 1 (bit combination 00000001 in most significant bit first notation). A recipient MUST be prepared to process values with leading zero bytes.
Implementation Note: The exceptional behavior permitted for the sender is intended for highly constrained, templated implementations (e.g., hardware implementations) that use fixed-size options in the templates.
string: A Unicode string that is encoded using UTF-8 [RFC3629] in Net-Unicode form [RFC5198].
Note that here, and in all other places where UTF-8 encoding is used in the CoAP protocol, the intention is that the encoded strings can be directly used and compared as opaque byte strings by CoAP protocol implementations. There is no expectation and no need to perform normalization within a CoAP implementation (except where Unicode strings that are not known to be normalized are imported from sources outside the CoAP protocol). Note also that ASCII strings (that do not make use of special control characters) are always valid UTF-8 Net-Unicode strings.
Tuple Fields§
§0: C
Implementations§
Trait Implementations§
source§impl<C> FromIterator<u8> for OptValue<C>where
C: FromIterator<u8>,
impl<C> FromIterator<u8> for OptValue<C>where C: FromIterator<u8>,
source§impl<C> Ord for OptValue<C>where
C: Array<Item = u8>,
impl<C> Ord for OptValue<C>where C: Array<Item = u8>,
source§impl<C> PartialEq<OptValue<C>> for OptValue<C>where
C: Array<Item = u8>,
impl<C> PartialEq<OptValue<C>> for OptValue<C>where C: Array<Item = u8>,
source§impl<C> PartialOrd<OptValue<C>> for OptValue<C>where
C: Array<Item = u8>,
impl<C> PartialOrd<OptValue<C>> for OptValue<C>where C: Array<Item = u8>,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more