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: ShareableMessageHandler
The shareable message handler for the subscription.
handler_id: Ustr
Store a copy of the handler ID for faster equality checks.
pattern: MStr<Pattern>
The pattern for the subscription.
priority: u8
The 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§const fn clone_from(&mut self, source: &Self)
const 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
Compare self to
key
and return true
if they are equal.