Struct distant_net::common::InmemoryTransport
source · pub struct InmemoryTransport { /* private fields */ }Expand description
Represents a Transport comprised of two inmemory channels
Implementations
sourceimpl InmemoryTransport
impl InmemoryTransport
sourcepub fn pair(buffer: usize) -> (Self, Self)
pub fn pair(buffer: usize) -> (Self, Self)
Returns pair of transports that are connected such that one sends to the other and vice versa
sourcepub fn link(&mut self, other: &mut InmemoryTransport, buffer: usize)
pub fn link(&mut self, other: &mut InmemoryTransport, buffer: usize)
Links two independent InmemoryTransport together by dropping their internal channels
and generating new ones of buffer capacity to connect these transports.
Note
This will drop any pre-existing data in the internal storage to avoid corruption.
Trait Implementations
sourceimpl Debug for InmemoryTransport
impl Debug for InmemoryTransport
sourceimpl Reconnectable for InmemoryTransport
impl Reconnectable for InmemoryTransport
sourcefn reconnect<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn reconnect<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Once the underlying channels have closed, there is no way for this transport to
re-establish those channels; therefore, reconnecting will fail with
ErrorKind::ConnectionRefused if either underlying channel has closed.
sourceimpl Transport for InmemoryTransport
impl Transport for InmemoryTransport
sourcefn try_read(&self, buf: &mut [u8]) -> Result<usize>
fn try_read(&self, buf: &mut [u8]) -> Result<usize>
Tries to read data from the transport into the provided buffer, returning how many bytes
were read. Read more
Auto Trait Implementations
impl !RefUnwindSafe for InmemoryTransport
impl Send for InmemoryTransport
impl Sync for InmemoryTransport
impl Unpin for InmemoryTransport
impl !UnwindSafe for InmemoryTransport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more