pub struct Subscription {
pub handler: ShareableMessageHandler,
pub handler_id: Ustr,
pub pattern: MStr<Pattern>,
pub priority: u8,
}Expand description
Represents a subscription to a particular topic.
This is an internal class intended to be used by the message bus to organize topics and their subscribers.
Fields§
§handler: ShareableMessageHandlerThe shareable message handler for the subscription.
handler_id: UstrStore a copy of the handler ID for faster equality checks.
pattern: MStr<Pattern>The pattern for the subscription.
priority: u8The priority for the subscription determines the ordering of handlers receiving messages being processed, higher priority handlers will receive messages before lower priority handlers.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn new(
pattern: MStr<Pattern>,
handler: ShareableMessageHandler,
priority: Option<u8>,
) -> Self
pub fn new( pattern: MStr<Pattern>, handler: ShareableMessageHandler, priority: Option<u8>, ) -> Self
Creates a new Subscription instance.
Trait Implementations§
Source§impl Clone for Subscription
impl Clone for Subscription
Source§fn clone(&self) -> Subscription
fn clone(&self) -> Subscription
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Subscription
impl Debug for Subscription
Source§impl Hash for Subscription
impl Hash for Subscription
Source§impl Ord for Subscription
impl Ord for Subscription
Source§impl PartialEq for Subscription
impl PartialEq for Subscription
Source§impl PartialOrd for Subscription
impl PartialOrd for Subscription
impl Eq for Subscription
Auto Trait Implementations§
impl Freeze for Subscription
impl !RefUnwindSafe for Subscription
impl !Send for Subscription
impl !Sync for Subscription
impl Unpin for Subscription
impl !UnwindSafe for Subscription
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§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