[−][src]Trait async_coap::send_desc::SendDescUnicast
Marker trait for identifying that this SendDesc
is for unicast requests.
Also contains unicast-specific combinators, such as block2()
.
Provided methods
fn block2<IC, R, TP>(self, block2: Option<BlockInfo>) -> UnicastBlock2<Self, IC> where
IC: InboundContext,
R: Send,
TP: TransParams,
Self: SendDesc<IC, R, TP> + Sized,
IC: InboundContext,
R: Send,
TP: TransParams,
Self: SendDesc<IC, R, TP> + Sized,
Returns a send descriptor that will perform Block2 processing.
Note that just adding this to your send descriptor chain alone is unlikely to do what you want. You've got three options:
- Add a call to
emit_successful_collected_response
immediately after the call to this method. This will cause the message to be reconstructed from the blocks and returned as a value from the future fromsend
. You can optionally add aninspect
combinator to get some feedback as the message is being reconstructed from all of the individual block messages. - Add a call to
emit_successful_response
along with usingsend_to_stream
instead ofsend
. This will give you aStream
that will contain all of the individual block messages in the stream. - Add your own handler to do whatever you need to do, returning
ResponseStatus::SendNext
until all of the blocks have been received. This is useful if you want to avoid memory allocation.
There may be other valid combinations of combinators, depending on what you are trying to do.