[][src]Trait async_coap::RespondableInboundContext

pub trait RespondableInboundContext: InboundContext {
    fn is_multicast(&self) -> bool;
fn is_fake(&self) -> bool;
fn respond<F>(&self, msg_gen: F) -> Result<(), Error>
    where
        F: Fn(&mut dyn MessageWrite) -> Result<(), Error>
; }

Represents the context for processing an inbound request that can be responded to.

Required methods

fn is_multicast(&self) -> bool

Indicates if the inbound request was a multicast request or not. Multicast requests have additional response timing requirements in order to avoid congestion.

fn is_fake(&self) -> bool

Indicates if this inbound request is from a real inbound request or if it is a fake request that is being generated internally to solicit a response. Fake requests are only generated for the GET method.

fn respond<F>(&self, msg_gen: F) -> Result<(), Error> where
    F: Fn(&mut dyn MessageWrite) -> Result<(), Error>, 

Responds to this inbound request using a message generated from msg_gen. The msg_id and msg_token fields will be automatically populated. This method will return the value returned by msg_gen.

Loading content...

Implementors

impl RespondableInboundContext for NullRespondableInboundContext[src]

impl<UA: SocketAddrExt> RespondableInboundContext for DatagramRespondableInboundContext<UA>[src]

Loading content...