pub enum LoopbackDuplex {}Expand description
The constructor for a loopback duplex.
Deliberately uninhabited: it names the constructor and owns its documentation, and there is no duplex value to hold — a duplex IS its two ends, and each end is owned by the side that uses it.
Implementations§
Source§impl LoopbackDuplex
impl LoopbackDuplex
Sourcepub fn bounded(
capacity_per_ring: usize,
) -> (LoopbackClientEnd, LoopbackServerEnd)
pub fn bounded( capacity_per_ring: usize, ) -> (LoopbackClientEnd, LoopbackServerEnd)
Builds a duplex with capacity_per_ring bytes in each direction and
returns its two ends.
The capacity is per ring, not shared: a full client-to-server ring does
not starve the server-to-client direction, which is the property that
lets a server drain a reply while its inbound side is backed up. The
capacity is floored at [MIN_RING_CAPACITY_BYTES] so a caller’s zero
cannot build a duplex that can never move a byte.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoopbackDuplex
impl RefUnwindSafe for LoopbackDuplex
impl Send for LoopbackDuplex
impl Sync for LoopbackDuplex
impl Unpin for LoopbackDuplex
impl UnsafeUnpin for LoopbackDuplex
impl UnwindSafe for LoopbackDuplex
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