pub struct AsyncSpscRing { /* private fields */ }Expand description
Wrapper providing .recv(timeout).await and .send(timeout).await.
Implementations§
Source§impl AsyncSpscRing
impl AsyncSpscRing
Sourcepub fn new(inner: Arc<BlockingSpscRing>) -> Self
pub fn new(inner: Arc<BlockingSpscRing>) -> Self
Wrap an existing BlockingSpscRing. Both halves share the
same underlying ring + wakers; this is just an async-shaped
view of the same primitive.
Sourcepub fn recv(&self, timeout: Duration) -> AsyncRecv ⓘ
pub fn recv(&self, timeout: Duration) -> AsyncRecv ⓘ
Async pop with bounded wait. Returns a future that resolves
when an item arrives, or BlockingError::Timeout after the
caller-supplied duration.
Sourcepub fn send(&self, payload: Vec<u8>, timeout: Duration) -> AsyncSend ⓘ
pub fn send(&self, payload: Vec<u8>, timeout: Duration) -> AsyncSend ⓘ
Async push with bounded wait.
Sourcepub fn inner(&self) -> &Arc<BlockingSpscRing> ⓘ
pub fn inner(&self) -> &Arc<BlockingSpscRing> ⓘ
Direct access to the underlying blocking ring.
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncSpscRing
impl !UnwindSafe for AsyncSpscRing
impl Freeze for AsyncSpscRing
impl Send for AsyncSpscRing
impl Sync for AsyncSpscRing
impl Unpin for AsyncSpscRing
impl UnsafeUnpin for AsyncSpscRing
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