pub struct MemoryResponseChannel {
pub sender: Sender<CanonicalMessage>,
pub receiver: Receiver<CanonicalMessage>,
/* private fields */
}Expand description
A shareable, thread-safe, in-memory channel for responses.
Fields§
§sender: Sender<CanonicalMessage>§receiver: Receiver<CanonicalMessage>Implementations§
Source§impl MemoryResponseChannel
impl MemoryResponseChannel
pub fn new(capacity: usize) -> Self
pub fn close(&self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub async fn wait_for_response(&self) -> Result<CanonicalMessage>
pub async fn register_waiter( &self, correlation_id: &str, sender: Sender<CanonicalMessage>, ) -> Result<()>
pub async fn remove_waiter( &self, correlation_id: &str, ) -> Option<Sender<CanonicalMessage>>
Trait Implementations§
Source§impl Clone for MemoryResponseChannel
impl Clone for MemoryResponseChannel
Source§fn clone(&self) -> MemoryResponseChannel
fn clone(&self) -> MemoryResponseChannel
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 MemoryResponseChannel
impl !Unpin for MemoryResponseChannel
impl !UnsafeUnpin for MemoryResponseChannel
impl !UnwindSafe for MemoryResponseChannel
impl Freeze for MemoryResponseChannel
impl Send for MemoryResponseChannel
impl Sync for MemoryResponseChannel
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