Trait RespondableInboundContext

Source
pub trait RespondableInboundContext: InboundContext {
    // Required methods
    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>;
}
Expand description

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

Required Methods§

Source

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.

Source

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.

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§