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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ConversationHandle
impl !UnwindSafe for ConversationHandle
impl Freeze for ConversationHandle
impl Send for ConversationHandle
impl Sync for ConversationHandle
impl Unpin for ConversationHandle
impl UnsafeUnpin for ConversationHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more