pub struct SimpleRendered<T: SimpleRenderable>(pub T);
Expand description
A container that turns any SimpleRenderable (including &str) into a CoAP resource Handler.
See SimpleRenderable for further information.
Tuple Fields§
§0: T
Implementations§
Source§impl<'a> SimpleRendered<TypedStaticRenderable<'a>>
impl<'a> SimpleRendered<TypedStaticRenderable<'a>>
pub fn new_typed_slice(data: &'a [u8], content_format: Option<u16>) -> Self
pub fn new_typed_str(data: &'a str, content_format: Option<u16>) -> Self
Trait Implementations§
Source§impl<T: Clone + SimpleRenderable> Clone for SimpleRendered<T>
impl<T: Clone + SimpleRenderable> Clone for SimpleRendered<T>
Source§fn clone(&self) -> SimpleRendered<T>
fn clone(&self) -> SimpleRendered<T>
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<T: Debug + SimpleRenderable> Debug for SimpleRendered<T>
impl<T: Debug + SimpleRenderable> Debug for SimpleRendered<T>
Source§impl<T> Handler for SimpleRendered<T>where
T: SimpleRenderable,
impl<T> Handler for SimpleRendered<T>where
T: SimpleRenderable,
Source§type ExtractRequestError = Error
type ExtractRequestError = Error
Error type for
extract_request_data()
. Read moreSource§type BuildResponseError<M: MinimalWritableMessage> = <M as MinimalWritableMessage>::UnionError
type BuildResponseError<M: MinimalWritableMessage> = <M as MinimalWritableMessage>::UnionError
Error type for writing response data. Read more
Source§fn extract_request_data<M: ReadableMessage>(
&mut self,
request: &M,
) -> Result<Self::RequestData, Error>
fn extract_request_data<M: ReadableMessage>( &mut self, request: &M, ) -> Result<Self::RequestData, Error>
Process an incoming request. Read more
Source§fn estimate_length(&mut self, _request: &Self::RequestData) -> usize
fn estimate_length(&mut self, _request: &Self::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<T> Reporting for SimpleRendered<T>where
T: SimpleRenderable,
impl<T> Reporting for SimpleRendered<T>where
T: SimpleRenderable,
impl<T: Copy + SimpleRenderable> Copy for SimpleRendered<T>
Auto Trait Implementations§
impl<T> Freeze for SimpleRendered<T>where
T: Freeze,
impl<T> RefUnwindSafe for SimpleRendered<T>where
T: RefUnwindSafe,
impl<T> Send for SimpleRendered<T>where
T: Send,
impl<T> Sync for SimpleRendered<T>where
T: Sync,
impl<T> Unpin for SimpleRendered<T>where
T: Unpin,
impl<T> UnwindSafe for SimpleRendered<T>where
T: UnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
fn at<H>(self, path: &'a [&'a str], handler: H) -> ForkingHandler<'a, H, Self>
Source§fn at_with_attributes<H>(
self,
path: &'a [&'a str],
attributes: &'a [Attribute],
handler: H,
) -> ForkingHandler<'a, ConstantSingleRecordReport<'a, H>, Self>
fn at_with_attributes<H>( self, path: &'a [&'a str], attributes: &'a [Attribute], handler: H, ) -> ForkingHandler<'a, ConstantSingleRecordReport<'a, H>, Self>
Divert requests arriving at
path
into the given handler
, and announce them with the
given attributes in .well-known/core. Read moreSource§impl<'a, OldRD, OldH> ReportingHandlerBuilder<'a, OldRD> for OldH
impl<'a, OldRD, OldH> ReportingHandlerBuilder<'a, OldRD> for OldH
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.