Function coap_numbers::code::to_name
source · pub fn to_name(code: u8) -> Option<&'static str>
Expand description
Find the name for a CoAP code, if any is known
Returns the registered name for a code, or None if the code is not known.
assert_eq!(to_name(HOP_LIMIT_REACHED), Some("Hop Limit Reached"));
assert_eq!(to_name(0x31), None);