[][src]Trait async_coap::send_desc::SendDescUnicast

pub trait SendDescUnicast {
    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
, { ... } }

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

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 from send. You can optionally add an inspect 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 using send_to_stream instead of send. This will give you a Stream 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.

Loading content...

Implementors

impl<IC> SendDescUnicast for CoapRequestMethod<IC>[src]

impl<IC> SendDescUnicast for SendDelete<IC>[src]

impl<IC> SendDescUnicast for SendGet<IC>[src]

impl<IC> SendDescUnicast for SendObserve<IC>[src]

impl<IC> SendDescUnicast for SendPost<IC>[src]

impl<IC> SendDescUnicast for SendPut<IC>[src]

impl<SD: SendDescUnicast> SendDescUnicast for EmitAnyResponse<SD>[src]

impl<SD: SendDescUnicast> SendDescUnicast for EmitMsgCode<SD>[src]

impl<SD: SendDescUnicast> SendDescUnicast for IncludeSocketAddr<SD>[src]

impl<SD: SendDescUnicast> SendDescUnicast for Nonconfirmable<SD>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for Handler<SD, IC>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for Inspect<SD, IC>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for PayloadWriter<SD, IC>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for UnicastBlock2<SD, IC>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for UnicastBlock2Collect<SD, IC>[src]

impl<SD: SendDescUnicast, IC> SendDescUnicast for UriHostPath<SD, IC>[src]

impl<SD: SendDescUnicast, K, I: Send, IC> SendDescUnicast for AddOption<SD, K, I, IC>[src]

Loading content...