#[repr(u8)]pub enum CoapMessageCode {
Empty,
Request(CoapRequestCode),
Response(CoapResponseCode),
}
Expand description
Representation of a CoAP message code. Can be a request code, a response code, or the empty message code.
The numeric value (that can also be obtained with to_raw_request()) corresponds to the values defined in https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#codes.
Variants§
Implementations§
Source§impl CoapMessageCode
impl CoapMessageCode
Sourcepub fn to_raw_pdu_code(self) -> coap_pdu_code_t
pub fn to_raw_pdu_code(self) -> coap_pdu_code_t
Returns the corresponding raw code for this message code, which can be added to a raw coap_pdu_t.
Trait Implementations§
Source§impl Clone for CoapMessageCode
impl Clone for CoapMessageCode
Source§fn clone(&self) -> CoapMessageCode
fn clone(&self) -> CoapMessageCode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CoapMessageCode
impl Debug for CoapMessageCode
Source§impl From<CoapRequestCode> for CoapMessageCode
impl From<CoapRequestCode> for CoapMessageCode
Source§fn from(code: CoapRequestCode) -> Self
fn from(code: CoapRequestCode) -> Self
Converts to this type from the input type.
Source§impl From<CoapResponseCode> for CoapMessageCode
impl From<CoapResponseCode> for CoapMessageCode
Source§fn from(code: CoapResponseCode) -> Self
fn from(code: CoapResponseCode) -> Self
Converts to this type from the input type.
Source§impl Hash for CoapMessageCode
impl Hash for CoapMessageCode
Source§impl PartialEq for CoapMessageCode
impl PartialEq for CoapMessageCode
Source§impl TryFrom<u32> for CoapMessageCode
impl TryFrom<u32> for CoapMessageCode
impl Copy for CoapMessageCode
impl Eq for CoapMessageCode
impl StructuralPartialEq for CoapMessageCode
Auto Trait Implementations§
impl Freeze for CoapMessageCode
impl RefUnwindSafe for CoapMessageCode
impl Send for CoapMessageCode
impl Sync for CoapMessageCode
impl Unpin for CoapMessageCode
impl UnwindSafe for CoapMessageCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more