Struct riot_coap_handler_demos::saul::SaulHandler
source · pub struct SaulHandler { /* private fields */ }
Expand description
A handler for SAUL requests, using SAUL_MATCH_SUBTREE to manage its resources.
The path this is registered at must be passed in as the prefix, as link-format responses necessitate knowing one’s own path, and the prefix needs to be stripped off when processing the Uri-Path options.
As the link-format handler is bad, the name must be simple.
Implementations§
Trait Implementations§
source§impl Handler for SaulHandler
impl Handler for SaulHandler
§type RequestData = SaulRequest
type RequestData = SaulRequest
§type ExtractRequestError = Error
type ExtractRequestError = Error
Error type for
extract_request_data()
. Read more§type BuildResponseError<M: MinimalWritableMessage> = Error
type BuildResponseError<M: MinimalWritableMessage> = Error
Error type for writing response data. Read more
source§fn extract_request_data<M: ReadableMessage>(
&mut self,
request: &M
) -> Result<SaulRequest, Error>
fn extract_request_data<M: ReadableMessage>( &mut self, request: &M ) -> Result<SaulRequest, Error>
Process an incoming request. Read more
source§fn estimate_length(&mut self, _: &<Self as Handler>::RequestData) -> usize
fn estimate_length(&mut self, _: &<Self as Handler>::RequestData) -> usize
Estimate an upper bound for the number of bytes in the response Read more
source§fn build_response<M: MutableWritableMessage>(
&mut self,
response: &mut M,
request: Self::RequestData
) -> Result<(), Self::BuildResponseError<M>>
fn build_response<M: MutableWritableMessage>( &mut self, response: &mut M, request: Self::RequestData ) -> Result<(), Self::BuildResponseError<M>>
Build a response for the request Read more
source§impl Reporting for SaulHandler
impl Reporting for SaulHandler
A SaulHandler lists all its SAUL devices in /.well-known/core. This is especially useful when registering at a Resource Directory using simple registration and lookup clients try to discover sensors.
type Record<'res> = Record
type Reporter<'res> = Chain<Once<Record>, Map<Filter<Enumerate<MapWhile<Map<RangeFrom<usize>, fn(_: usize) -> Option<RegistryEntry>>, fn(_: Option<RegistryEntry>) -> Option<RegistryEntry>>>, fn(_: &(usize, RegistryEntry)) -> bool>, fn(_: (usize, RegistryEntry)) -> Record>>
fn report(&self) -> Self::Reporter<'_>
Auto Trait Implementations§
impl RefUnwindSafe for SaulHandler
impl Send for SaulHandler
impl Sync for SaulHandler
impl Unpin for SaulHandler
impl UnwindSafe for SaulHandler
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
source§impl<'a, OldRD, OldH> HandlerBuilder<'a, OldRD> for OldHwhere
OldH: Handler<RequestData = OldRD>,
impl<'a, OldRD, OldH> HandlerBuilder<'a, OldRD> for OldHwhere
OldH: Handler<RequestData = OldRD>,
source§fn at<H>(self, path: &'a [&'a str], handler: H) -> ForkingHandler<'a, H, Self>where
H: Handler,
fn at<H>(self, path: &'a [&'a str], handler: H) -> ForkingHandler<'a, H, Self>where
H: Handler,
source§fn at_with_attributes<H>(
self,
path: &'a [&'a str],
attributes: &'a [Attribute],
handler: H
) -> ForkingHandler<'a, ConstantSingleRecordReport<'a, H>, Self>where
H: Handler,
fn at_with_attributes<H>(
self,
path: &'a [&'a str],
attributes: &'a [Attribute],
handler: H
) -> ForkingHandler<'a, ConstantSingleRecordReport<'a, H>, Self>where
H: Handler,
Divert requests arriving at
path
into the given handler
, and announce them with the
given attributes in .well-known/core. Read more