pub struct ChatMeshBridge { /* private fields */ }Expand description
Per-peer reliable chat routing over the mesh. One bridge per node; it holds a
ReliableEndpoint per peer DID.
Implementations§
Source§impl ChatMeshBridge
impl ChatMeshBridge
Sourcepub fn new(rto_ms: u64, max_attempts: u32) -> ChatMeshBridge
pub fn new(rto_ms: u64, max_attempts: u32) -> ChatMeshBridge
A bridge with explicit reliability parameters (mostly for tests).
Sourcepub fn broadcast(
&mut self,
peer_dids: &[String],
env: &RelayEnvelope,
now_ms: u64,
) -> Vec<OutFrame>
pub fn broadcast( &mut self, peer_dids: &[String], env: &RelayEnvelope, now_ms: u64, ) -> Vec<OutFrame>
Reliably send env to every peer in peer_dids. The envelope is encoded once; each peer’s
channel assigns its own sequence number. Returns the frames to send.
Sourcepub fn send_to(
&mut self,
peer_did: &str,
env: &RelayEnvelope,
now_ms: u64,
) -> OutFrame
pub fn send_to( &mut self, peer_did: &str, env: &RelayEnvelope, now_ms: u64, ) -> OutFrame
Reliably send env to a single peer.
Sourcepub fn on_inbound(
&mut self,
peer_did: &str,
frame: &[u8],
now_ms: u64,
) -> InboundChat
pub fn on_inbound( &mut self, peer_did: &str, frame: &[u8], now_ms: u64, ) -> InboundChat
Process one inbound reliable-channel frame from peer_did. Returns the ACK to send back and,
if the frame completed a new envelope, the decoded RelayEnvelope to apply.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChatMeshBridge
impl RefUnwindSafe for ChatMeshBridge
impl Send for ChatMeshBridge
impl Sync for ChatMeshBridge
impl Unpin for ChatMeshBridge
impl UnsafeUnpin for ChatMeshBridge
impl UnwindSafe for ChatMeshBridge
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.