pub struct DuplexChannel { /* private fields */ }Expand description
Implementations§
Source§impl DuplexChannel
impl DuplexChannel
Sourcepub async fn send(
&mut self,
payload: &Value,
correlation_id: Option<&str>,
) -> Result<String, PulseError>
pub async fn send( &mut self, payload: &Value, correlation_id: Option<&str>, ) -> Result<String, PulseError>
Publish payload to the agent’s input topic.
Returns the correlation id (generated when correlation_id is None)
that the matching output will carry.
Sourcepub async fn recv(&mut self) -> Result<DuplexOutput, PulseError>
pub async fn recv(&mut self) -> Result<DuplexOutput, PulseError>
Return the next agent output event.
Skips ack / pong / connected frames transparently. An error
frame surfaces as PulseError::Validation.
Sourcepub async fn close(self) -> Result<(), PulseError>
pub async fn close(self) -> Result<(), PulseError>
Close the channel cleanly.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DuplexChannel
impl !RefUnwindSafe for DuplexChannel
impl Send for DuplexChannel
impl Sync for DuplexChannel
impl Unpin for DuplexChannel
impl UnsafeUnpin for DuplexChannel
impl !UnwindSafe for DuplexChannel
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