Enum libcoap_rs::protocol::CoapMessageCode
source · #[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
Empty
Request(CoapRequestCode)
Response(CoapResponseCode)
Implementations
sourceimpl 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
sourceimpl Clone for CoapMessageCode
impl Clone for CoapMessageCode
sourcefn clone(&self) -> CoapMessageCode
fn clone(&self) -> CoapMessageCode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CoapMessageCode
impl Debug for CoapMessageCode
sourceimpl From<CoapRequestCode> for CoapMessageCode
impl From<CoapRequestCode> for CoapMessageCode
sourcefn from(code: CoapRequestCode) -> Self
fn from(code: CoapRequestCode) -> Self
Converts to this type from the input type.
sourceimpl From<CoapResponseCode> for CoapMessageCode
impl From<CoapResponseCode> for CoapMessageCode
sourcefn from(code: CoapResponseCode) -> Self
fn from(code: CoapResponseCode) -> Self
Converts to this type from the input type.
sourceimpl Hash for CoapMessageCode
impl Hash for CoapMessageCode
sourceimpl PartialEq<CoapMessageCode> for CoapMessageCode
impl PartialEq<CoapMessageCode> for CoapMessageCode
sourcefn eq(&self, other: &CoapMessageCode) -> bool
fn eq(&self, other: &CoapMessageCode) -> bool
sourceimpl TryFrom<coap_pdu_code_t> for CoapMessageCode
impl TryFrom<coap_pdu_code_t> for CoapMessageCode
type Error = MessageCodeError
type Error = MessageCodeError
The type returned in the event of a conversion error.
sourcefn try_from(code: coap_pdu_code_t) -> Result<Self, Self::Error>
fn try_from(code: coap_pdu_code_t) -> Result<Self, Self::Error>
Performs the conversion.
impl Copy for CoapMessageCode
impl Eq for CoapMessageCode
impl StructuralEq for CoapMessageCode
impl StructuralPartialEq for CoapMessageCode
Auto Trait Implementations
impl RefUnwindSafe for CoapMessageCode
impl Send for CoapMessageCode
impl Sync for CoapMessageCode
impl Unpin for CoapMessageCode
impl UnwindSafe for CoapMessageCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more