Skip to main content

RequestReply

Trait RequestReply 

Source
pub trait RequestReply {
    // Required methods
    async fn request_reply<M>(
        &mut self,
        request: RequestReplyRequest<M>,
    ) -> ClientResult<Box<dyn MessageTrait + Send>>
       where M: MessageTrait + Send + Sync;
    async fn request_reply_with_callback<M>(
        &mut self,
        request: RequestReplyCallbackRequest<M>,
    ) -> ClientResult<()>
       where M: MessageTrait + Send + Sync;
    async fn request_reply_selected<M, S, T>(
        &mut self,
        request: SelectedRequestReplyRequest<M, S, T>,
    ) -> ClientResult<Box<dyn MessageTrait + Send>>
       where M: MessageTrait + Send + Sync,
             S: Fn(&[MessageQueue], &M, &T) -> Option<MessageQueue> + Send + Sync + 'static,
             T: Send + Sync + 'static;
    async fn request_reply_selected_with_callback<M, S, T>(
        &mut self,
        request: SelectedRequestReplyCallbackRequest<M, S, T>,
    ) -> ClientResult<()>
       where M: MessageTrait + Send + Sync,
             S: Fn(&[MessageQueue], &M, &T) -> Option<MessageQueue> + Send + Sync + 'static,
             T: Send + Sync + 'static;
}
Expand description

Request/reply capability.

Required Methods§

Source

async fn request_reply<M>( &mut self, request: RequestReplyRequest<M>, ) -> ClientResult<Box<dyn MessageTrait + Send>>
where M: MessageTrait + Send + Sync,

Sends a request and waits for its correlated reply.

§Errors

Preserves the existing timeout, routing, and remoting errors.

Source

async fn request_reply_with_callback<M>( &mut self, request: RequestReplyCallbackRequest<M>, ) -> ClientResult<()>
where M: MessageTrait + Send + Sync,

Sends a request and reports its correlated reply through a callback.

§Errors

Preserves timeout, routing, and submission errors.

Source

async fn request_reply_selected<M, S, T>( &mut self, request: SelectedRequestReplyRequest<M, S, T>, ) -> ClientResult<Box<dyn MessageTrait + Send>>
where M: MessageTrait + Send + Sync, S: Fn(&[MessageQueue], &M, &T) -> Option<MessageQueue> + Send + Sync + 'static, T: Send + Sync + 'static,

Sends a selector-routed request and waits for its reply.

§Errors

Preserves selector, timeout, routing, and remoting errors.

Source

async fn request_reply_selected_with_callback<M, S, T>( &mut self, request: SelectedRequestReplyCallbackRequest<M, S, T>, ) -> ClientResult<()>
where M: MessageTrait + Send + Sync, S: Fn(&[MessageQueue], &M, &T) -> Option<MessageQueue> + Send + Sync + 'static, T: Send + Sync + 'static,

Sends a selector-routed request and reports its reply through a callback.

§Errors

Preserves selector, timeout, routing, and submission errors.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§