pub struct Router { /* private fields */ }Implementations§
Source§impl Router
impl Router
pub fn new(config: RouterConfig) -> Self
pub fn peer_id(&self) -> &str
pub fn known_peers(&self) -> Vec<PeerPresence>
pub fn forget_peer(&self, peer_id: &str)
pub fn stats(&self) -> RouterStats
pub fn wrap_sync( &self, encoding: impl Into<String>, payload: JsonValue, target: RouteTarget, ) -> RouteEnvelope
pub fn wrap_signal( &self, room: impl Into<String>, payload: JsonValue, target: RouteTarget, ) -> RouteEnvelope
pub fn wrap_pull_request( &self, request: PullRequest, target: RouteTarget, ) -> RouteEnvelope
pub fn wrap_pull_response( &self, response: PullResponse, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn wrap_watch_request( &self, request: WatchRequest, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn wrap_watch_event( &self, event: WatchEvent, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn wrap_batch( &self, items: Vec<RouteBatchItem>, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn wrap_batch_item( &self, item: RouteBatchItem, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn presence( &self, replica_id: impl Into<String>, transport: impl Into<String>, capabilities: Vec<String>, topics: Vec<String>, ) -> RouteEnvelope
pub fn peer_exchange( &self, peers: Vec<PeerRecommendation>, target: RouteTarget, reply_to: impl Into<Option<String>>, ) -> RouteEnvelope
pub fn snapshot_request( &self, root: Option<String>, target: RouteTarget, ) -> RouteEnvelope
pub fn snapshot_response( &self, root: Option<String>, snapshot: DatabaseSnapshot, target: RouteTarget, ) -> RouteEnvelope
pub fn accept(&self, envelope: RouteEnvelope) -> RouteDecision
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router
impl RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnwindSafe for Router
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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