pub struct SubscriptionHandler { /* private fields */ }Expand description
Manages a peer’s subscription to this node’s reactor.
This handler owns both the ReactorSubscription and the SubscriptionGuard for listening to changes on that subscription.
Implementations§
Source§impl SubscriptionHandler
impl SubscriptionHandler
pub fn new<SE, PA>(peer_id: EntityId, node: &Node<SE, PA>) -> Self
Sourcepub fn subscription_id(&self) -> ReactorSubscriptionId
pub fn subscription_id(&self) -> ReactorSubscriptionId
Get the subscription ID for this peer.
Sourcepub fn subscription(&self) -> &ReactorSubscription
pub fn subscription(&self) -> &ReactorSubscription
Get a reference to the subscription for adding/removing predicates.
Sourcepub fn remove_predicate(
&self,
query_id: QueryId,
) -> Result<(), SubscriptionError>
pub fn remove_predicate( &self, query_id: QueryId, ) -> Result<(), SubscriptionError>
Remove a predicate from this peer’s subscription.
Sourcepub async fn subscribe_query<SE, PA>(
&self,
node: &Node<SE, PA>,
query_id: QueryId,
collection_id: CollectionId,
selection: Selection,
cdata: &PA::ContextData,
version: u32,
known_matches: Vec<KnownEntity>,
) -> Result<NodeResponseBody>
pub async fn subscribe_query<SE, PA>( &self, node: &Node<SE, PA>, query_id: QueryId, collection_id: CollectionId, selection: Selection, cdata: &PA::ContextData, version: u32, known_matches: Vec<KnownEntity>, ) -> Result<NodeResponseBody>
Handle a subscription request for this peer.
Auto Trait Implementations§
impl Freeze for SubscriptionHandler
impl !RefUnwindSafe for SubscriptionHandler
impl Send for SubscriptionHandler
impl Sync for SubscriptionHandler
impl Unpin for SubscriptionHandler
impl UnsafeUnpin for SubscriptionHandler
impl !UnwindSafe for SubscriptionHandler
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> 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> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.