[−][src]Struct coap_handler::implementations::SimpleCBORWrapper
Wrapper for resource handlers that are implemented in terms of GETting, POSTing or PUTting objects in CBOR format.
The wrapper handles all encoding and decoding, options processing (ignoring the critical Uri-Path option under the assumption that that has been already processed by an underlying request router), the corresponding errors and block-wise GETs.
More complex handlers (eg. implementing additional representations, or processing query aprameters into additional data available to the SimpleCBORHandler) can be built by forwarding to this (where any critical but already processed options would need to be masked from the message's option) or taking inspiration from it.
Implementations
impl<H: SimpleCBORHandler> SimpleCBORWrapper<H>
[src]
Trait Implementations
impl<H> Handler for SimpleCBORWrapper<H> where
H: SimpleCBORHandler,
H::Get: Serialize,
H::Post: for<'de> Deserialize<'de>,
H::Put: for<'de> Deserialize<'de>,
[src]
H: SimpleCBORHandler,
H::Get: Serialize,
H::Post: for<'de> Deserialize<'de>,
H::Put: for<'de> Deserialize<'de>,
type RequestData = SimpleCBORRequestData
fn extract_request_data<'a>(
&mut self,
request: &'a impl ReadableMessage<'a>
) -> Self::RequestData
[src]
&mut self,
request: &'a impl ReadableMessage<'a>
) -> Self::RequestData
fn estimate_length(&mut self, request: &Self::RequestData) -> usize
[src]
fn build_response(
&mut self,
response: &mut impl MutableWritableMessage,
request: Self::RequestData
)
[src]
&mut self,
response: &mut impl MutableWritableMessage,
request: Self::RequestData
)
Auto Trait Implementations
impl<H> Send for SimpleCBORWrapper<H> where
H: Send,
H: Send,
impl<H> Sync for SimpleCBORWrapper<H> where
H: Sync,
H: Sync,
impl<H> Unpin for SimpleCBORWrapper<H> where
H: Unpin,
H: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<'a, OldRD, OldH> HandlerBuilder<'a, OldRD> for OldH where
OldH: Handler<RequestData = OldRD>,
[src]
OldH: Handler<RequestData = OldRD>,
pub fn at<H>(Self, &'a [&'a str], H) -> ForkingHandler<'a, H, OldH>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,