pub trait DispatchConversation: Debug + Send {
// Required methods
fn link_worker(
&mut self,
worker: &DispatchWorker,
) -> Result<(), AionSurfaceError>;
fn send(&mut self, request: DispatchRequest) -> Result<(), AionSurfaceError>;
fn receive(&mut self) -> Result<DispatchConversationEvent, AionSurfaceError>;
fn close(&mut self) -> Result<(), AionSurfaceError>;
}Expand description
Open dispatch conversation with typed zero-hop request and response methods.
Required Methods§
Sourcefn link_worker(
&mut self,
worker: &DispatchWorker,
) -> Result<(), AionSurfaceError>
fn link_worker( &mut self, worker: &DispatchWorker, ) -> Result<(), AionSurfaceError>
Links a selected worker process before the request is sent.
§Errors
Returns an error if the process link cannot be established.
Sourcefn send(&mut self, request: DispatchRequest) -> Result<(), AionSurfaceError>
fn send(&mut self, request: DispatchRequest) -> Result<(), AionSurfaceError>
Sends a typed dispatch request through the conversation.
§Errors
Returns an error if the conversation cannot accept the request.
Sourcefn receive(&mut self) -> Result<DispatchConversationEvent, AionSurfaceError>
fn receive(&mut self) -> Result<DispatchConversationEvent, AionSurfaceError>
Receives either a worker response or a linked-process exit event.
§Errors
Returns an error if the conversation cannot receive an event.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".