pub struct InMemoryEndpoint { /* private fields */ }Expand description
One end of an in-memory replication channel.
Implements Channel identically to crate::net::TcpChannel and
crate::net::TlsTcpChannel. Internally backed by
LocalChannel queues and a noxu_sync::Mutex.
Endpoints are constructed via InMemoryTransport::new_pair or
InMemoryTransport::new_group. Direct construction is intentionally
not exposed — pairing two endpoints requires the cross-connected
queues set up by the transport factory.
Implementations§
Source§impl InMemoryEndpoint
impl InMemoryEndpoint
Sourcepub fn channel_handle(&self) -> Arc<dyn Channel> ⓘ
pub fn channel_handle(&self) -> Arc<dyn Channel> ⓘ
Return a cheap shareable handle to this endpoint’s underlying
channel. Useful when the protocol layer wants
Arc<dyn Channel> (e.g., when spawning a reader thread that
outlives the borrow of the group).
Trait Implementations§
Source§impl Channel for InMemoryEndpoint
impl Channel for InMemoryEndpoint
Source§fn receive(&self, timeout: Duration) -> Result<Option<Vec<u8>>>
fn receive(&self, timeout: Duration) -> Result<Option<Vec<u8>>>
Receive a message, blocking until data is available or the timeout
expires. Returns
Ok(None) on timeout with no data.Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryEndpoint
impl !UnwindSafe for InMemoryEndpoint
impl Freeze for InMemoryEndpoint
impl Send for InMemoryEndpoint
impl Sync for InMemoryEndpoint
impl Unpin for InMemoryEndpoint
impl UnsafeUnpin for InMemoryEndpoint
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more