pub struct ConversationHandle { /* private fields */ }Expand description
Cloneable handle for interacting with a conversation actor.
Implementations§
Source§impl ConversationHandle
impl ConversationHandle
Sourcepub fn send(&self, message: impl Into<Envelope>) -> Result<(), LiminalError>
pub fn send(&self, message: impl Into<Envelope>) -> Result<(), LiminalError>
Sends a message envelope to the conversation actor.
§Errors
Returns a LiminalError when the actor cannot accept or process the message.
Sourcepub fn send_with_op_id(
&self,
message: impl Into<Envelope>,
op_id: Option<u64>,
) -> Result<(), LiminalError>
pub fn send_with_op_id( &self, message: impl Into<Envelope>, op_id: Option<u64>, ) -> Result<(), LiminalError>
Sends a message with the server’s in-process reply correlation marker.
Some(op_id) routes a produced reply to the correlated server queue;
None marks fire-and-forget traffic whose produced reply is discarded by
the participant runner. The marker never enters an Envelope or the wire.
§Errors
Returns a LiminalError when the actor cannot accept or process the message.
Sourcepub fn receive(&self) -> Result<Envelope, LiminalError>
pub fn receive(&self) -> Result<Envelope, LiminalError>
Receives the next available envelope from the conversation actor.
§Errors
Returns a LiminalError when the actor is closed, failed, or unavailable.
Sourcepub fn close(&self) -> Result<(), LiminalError>
pub fn close(&self) -> Result<(), LiminalError>
Closes the conversation normally.
§Errors
Returns a LiminalError when the actor cannot close normally.
Sourcepub fn query_state(&self) -> Result<ConversationState, LiminalError>
pub fn query_state(&self) -> Result<ConversationState, LiminalError>
Queries the actor state for diagnostics.
§Errors
Returns a LiminalError when the state cannot be queried.
Sourcepub fn actor_pid(&self) -> Result<ParticipantPid, LiminalError>
pub fn actor_pid(&self) -> Result<ParticipantPid, LiminalError>
Returns the current actor PID.
§Errors
Returns a LiminalError when the supervisor cannot inspect the actor.
Trait Implementations§
Source§impl Clone for ConversationHandle
impl Clone for ConversationHandle
Source§fn clone(&self) -> ConversationHandle
fn clone(&self) -> ConversationHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more