[][src]Enum async_coap::message::MsgCode

pub enum MsgCode {
    Empty,
    MethodGet,
    MethodPost,
    MethodPut,
    MethodDelete,
    MethodFetch,
    MethodPatch,
    MethodIPatch,
    SuccessCreated,
    SuccessDeleted,
    SuccessValid,
    SuccessChanged,
    SuccessContent,
    SuccessContinue,
    ClientErrorBadRequest,
    ClientErrorUnauthorized,
    ClientErrorBadOption,
    ClientErrorForbidden,
    ClientErrorNotFound,
    ClientErrorMethodNotAllowed,
    ClientErrorNotAcceptable,
    ClientErrorRequestEntityIncomplete,
    ClientErrorPreconditionFailed,
    ClientErrorRequestEntityTooLarge,
    ClientErrorUnsupportedMediaType,
    ClientErrorTooManyRequests,
    ServerErrorInternalServerError,
    ServerErrorNotImplemented,
    ServerErrorBadGateway,
    ServerErrorServiceUnavailable,
    ServerErrorGatewayTimeout,
    ServerErrorProxyingNotSupported,
    SignalCsm,
    SignalPing,
    SignalPong,
    SignalRelease,
    SignalAbort,
}

Enum representing a CoAP message code.

Variants

Empty

Empty message code. Only used for ping requests, resets, and empty acknowledgements.

MethodGet

CoAP GET method.

MethodPost

CoAP POST method.

MethodPut

CoAP PUT method.

MethodDelete

CoAP DELETE method.

MethodFetch

CoAP FETCH method.

MethodPatch

CoAP PATCH method.

MethodIPatch

CoAP iPATCH method.

SuccessCreated

CoAP CREATED success code.

SuccessDeleted

CoAP DELETED success code.

SuccessValid

CoAP VALID success code.

SuccessChanged

CoAP CHANGED success code.

SuccessContent

CoAP CONTENT success code.

SuccessContinue

CoAP CONTINUE success code.

ClientErrorBadRequest

CoAP BAD_REQUEST client error.

ClientErrorUnauthorized

CoAP UNAUTHORIZED client error.

ClientErrorBadOption

CoAP BAD_OPTION client error.

ClientErrorForbidden

CoAP FORBIDDEN client error.

ClientErrorNotFound

CoAP NOT_FOUND client error.

ClientErrorMethodNotAllowed

CoAP METHOD_NOT_ALLOWED client error.

ClientErrorNotAcceptable

CoAP NOT_ACCEPTABLE client error.

ClientErrorRequestEntityIncomplete

CoAP REQUEST_ENTITY_INCOMPLETE client error.

ClientErrorPreconditionFailed

CoAP PRECONDITION_FAILED client error.

ClientErrorRequestEntityTooLarge

CoAP REQUEST_ENTITY_TOO_LARGE client error.

ClientErrorUnsupportedMediaType

CoAP UNSUPPORTED_MEDIA_TYPE client error.

ClientErrorTooManyRequests

RFC8516 "Too Many Requests" Response Code for the Constrained Application Protocol

ServerErrorInternalServerError

CoAP INTERNAL_SERVER_ERROR server error.

ServerErrorNotImplemented

CoAP NOT_IMPLEMENTED server error.

ServerErrorBadGateway

CoAP BAD_GATEWAY server error.

ServerErrorServiceUnavailable

CoAP SERVICE_UNAVAILABLE server error.

ServerErrorGatewayTimeout

CoAP GATEWAY_TIMEOUT server error.

ServerErrorProxyingNotSupported

CoAP PROXYING_NOT_SUPPORTED server error.

SignalCsm

CoAP CSM in-band signal.

SignalPing

CoAP PING in-band signal.

SignalPong

CoAP PONG in-band signal.

SignalRelease

CoAP RELEASE in-band signal.

SignalAbort

CoAP ABORT in-band signal.

Methods

impl MsgCode[src]

pub fn try_from(x: u8) -> Option<MsgCode>[src]

Tries to convert the given u8 into a MsgCode. If the given code isn't recognized, this method will return None.

pub fn to_http_code(self) -> u16[src]

Returns an approximation of this message code as an HTTP status code.

pub fn is_empty(self) -> bool[src]

Returns true if this is the empty code.

pub fn is_method(self) -> bool[src]

Returns true if message code is a method.

pub fn is_client_error(self) -> bool[src]

Returns true if message code is a client error.

pub fn is_server_error(self) -> bool[src]

Returns true if message code is a server error.

pub fn is_error(self) -> bool[src]

Returns true if message code is any sort of error.

pub fn is_success(self) -> bool[src]

Returns true if message code indicates success.

pub fn is_signal(self) -> bool[src]

Returns true if message code is an in-band signal.

Trait Implementations

impl Clone for MsgCode[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for MsgCode[src]

impl From<MsgCode> for u8[src]

impl From<MsgCode> for u16[src]

impl From<MsgCode> for u32[src]

impl Copy for MsgCode[src]

impl Eq for MsgCode[src]

impl PartialEq<MsgCode> for MsgCode[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Debug for MsgCode[src]

Auto Trait Implementations

impl Unpin for MsgCode

impl Sync for MsgCode

impl Send for MsgCode

impl UnwindSafe for MsgCode

impl RefUnwindSafe for MsgCode

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,