pub struct DefaultSubscriptionManager<S: Subscriptions> { /* private fields */ }Expand description
Default subscription manager implementation
Implementations§
Source§impl<S: Subscriptions> DefaultSubscriptionManager<S>
impl<S: Subscriptions> DefaultSubscriptionManager<S>
Sourcepub fn compare_with(
&mut self,
other: &mut DefaultSubscriptionManager<S>,
) -> Result<HashMap<S::Subscriptions, SubscriptionDiff<S>>, NetabaseError>
pub fn compare_with( &mut self, other: &mut DefaultSubscriptionManager<S>, ) -> Result<HashMap<S::Subscriptions, SubscriptionDiff<S>>, NetabaseError>
Compare this manager with another manager and return differences for all topics
Sourcepub fn with_topics(topics: &[S::Subscriptions]) -> Self
pub fn with_topics(topics: &[S::Subscriptions]) -> Self
Initialize only specific topics
Trait Implementations§
Source§impl<S: Subscriptions> Default for DefaultSubscriptionManager<S>
impl<S: Subscriptions> Default for DefaultSubscriptionManager<S>
Source§impl<S: Subscriptions> SubscriptionManager<S> for DefaultSubscriptionManager<S>
impl<S: Subscriptions> SubscriptionManager<S> for DefaultSubscriptionManager<S>
Source§type TopicType = <S as Subscriptions>::Subscriptions
type TopicType = <S as Subscriptions>::Subscriptions
Associated types for topic-specific operations
Source§fn subscribe_item<T>(
&mut self,
topic: S::Subscriptions,
key: Vec<u8>,
data: &T,
) -> Result<(), NetabaseError>
fn subscribe_item<T>( &mut self, topic: S::Subscriptions, key: Vec<u8>, data: &T, ) -> Result<(), NetabaseError>
Add an item to the appropriate subscription tree(s)
Source§fn unsubscribe_item(
&mut self,
topic: S::Subscriptions,
key: &[u8],
) -> Result<Option<ModelHash>, NetabaseError>
fn unsubscribe_item( &mut self, topic: S::Subscriptions, key: &[u8], ) -> Result<Option<ModelHash>, NetabaseError>
Remove an item from the subscription tree(s)
Source§fn topic_merkle_root(
&mut self,
topic: S::Subscriptions,
) -> Result<Option<[u8; 32]>, NetabaseError>
fn topic_merkle_root( &mut self, topic: S::Subscriptions, ) -> Result<Option<[u8; 32]>, NetabaseError>
Get the merkle root for a specific topic
Source§fn stats(&self) -> SubscriptionStats
fn stats(&self) -> SubscriptionStats
Get statistics about the subscription manager
Auto Trait Implementations§
impl<S> Freeze for DefaultSubscriptionManager<S>
impl<S> RefUnwindSafe for DefaultSubscriptionManager<S>
impl<S> Send for DefaultSubscriptionManager<S>
impl<S> Sync for DefaultSubscriptionManager<S>
impl<S> Unpin for DefaultSubscriptionManager<S>
impl<S> UnwindSafe for DefaultSubscriptionManager<S>
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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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 more