pub struct DefaultRouter {
pub topics: Arc<RwLock<TopicTree<()>>>,
pub topics_count: Arc<Counter>,
pub relations: Arc<AllRelationsMap>,
pub relations_count: Arc<Counter>,
/* private fields */
}Fields§
§topics: Arc<RwLock<TopicTree<()>>>§topics_count: Arc<Counter>§relations: Arc<AllRelationsMap>§relations_count: Arc<Counter>Implementations§
Source§impl DefaultRouter
impl DefaultRouter
pub fn new(scx: Option<ServerContext>) -> DefaultRouter
pub async fn _has_matches(&self, topic: &str) -> Result<bool>
pub async fn _get_routes(&self, topic: &str) -> Result<Vec<Route>>
pub async fn _matches( &self, this_id: Id, topic_name: &TopicName, ) -> Result<SubRelationsMap>
Trait Implementations§
Source§impl Clone for DefaultRouter
impl Clone for DefaultRouter
Source§fn clone(&self) -> DefaultRouter
fn clone(&self) -> DefaultRouter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Router for DefaultRouter
impl Router for DefaultRouter
Source§fn add<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_filter: &'life1 str,
id: Id,
opts: SubscriptionOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_filter: &'life1 str,
id: Id,
opts: SubscriptionOptions,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Id add with topic filter
Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_filter: &'life1 str,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
topic_filter: &'life1 str,
id: Id,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove with id topic filter
Source§fn matches<'life0, 'life1, 'async_trait>(
&'life0 self,
id: Id,
topic: &'life1 TopicName,
) -> Pin<Box<dyn Future<Output = Result<SubRelationsMap>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn matches<'life0, 'life1, 'async_trait>(
&'life0 self,
id: Id,
topic: &'life1 TopicName,
) -> Pin<Box<dyn Future<Output = Result<SubRelationsMap>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Match with id and topic
Source§fn is_online<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: NodeId,
client_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_online<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: NodeId,
client_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check online or offline
Source§fn gets<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Vec<Route>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn gets<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = Vec<Route>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets by limit
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Route>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Route>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get by topic
Source§fn query_subscriptions<'life0, 'life1, 'async_trait>(
&'life0 self,
q: &'life1 SubsSearchParams,
) -> Pin<Box<dyn Future<Output = Vec<SubsSearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_subscriptions<'life0, 'life1, 'async_trait>(
&'life0 self,
q: &'life1 SubsSearchParams,
) -> Pin<Box<dyn Future<Output = Vec<SubsSearchResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
query subscriptions
Source§fn topics_tree<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn topics_tree<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Topics tree
Source§fn merge_topics(&self, topics_map: &HashMap<NodeId, Counter>) -> Counter
fn merge_topics(&self, topics_map: &HashMap<NodeId, Counter>) -> Counter
merge Topics with another
Source§fn merge_routes(&self, routes_map: &HashMap<NodeId, Counter>) -> Counter
fn merge_routes(&self, routes_map: &HashMap<NodeId, Counter>) -> Counter
merge routes with another
Source§fn list_topics<'life0, 'async_trait>(
&'life0 self,
top: usize,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_topics<'life0, 'async_trait>(
&'life0 self,
top: usize,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get topic tree
Source§fn list_relations<'life0, 'async_trait>(
&'life0 self,
top: usize,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_relations<'life0, 'async_trait>(
&'life0 self,
top: usize,
) -> Pin<Box<dyn Future<Output = Vec<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
get subscription relations
Source§fn relations(&self) -> &AllRelationsMap
fn relations(&self) -> &AllRelationsMap
all relations
Auto Trait Implementations§
impl Freeze for DefaultRouter
impl !RefUnwindSafe for DefaultRouter
impl Send for DefaultRouter
impl Sync for DefaultRouter
impl Unpin for DefaultRouter
impl UnsafeUnpin for DefaultRouter
impl !UnwindSafe for DefaultRouter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HashExt for Twhere
T: ?Sized,
impl<T> HashExt for Twhere
T: ?Sized,
fn hash_value(self, h: u64) -> HashWrapper<Self>where
Self: Sized,
fn hash_empty(self) -> EmptyHashWrapper<Self>where
Self: Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request