pub struct Root<N>where
N: Notification,{ /* private fields */ }Expand description
Root of a notification system
The Root receives new notifications via its notify function, transforms them according
to its internal subscription scope and, when any, sends them through a channel.
It is a SubscriptionManager, so the notification scope can be dynamically configured
according to the needs of the whole notification system.
Implementations§
Source§impl<N> Root<N>where
N: Notification,
impl<N> Root<N>where
N: Notification,
pub fn new(sender: Sender<N>) -> Self
pub fn with_context( sender: Sender<N>, subscription_context: SubscriptionContext, ) -> Self
pub fn send(&self, notification: N) -> Result<()>
pub fn close(&self) -> bool
pub fn is_closed(&self) -> bool
pub fn has_subscription(&self, event: EventType) -> bool
Trait Implementations§
Source§impl<N> Notify<N> for Root<N>where
N: Notification,
impl<N> Notify<N> for Root<N>where
N: Notification,
Source§impl<N> SubscriptionManager for Root<N>where
N: Notification,
impl<N> SubscriptionManager for Root<N>where
N: Notification,
fn start_notify<'life0, 'async_trait>(
&'life0 self,
__arg1: ListenerId,
scope: Scope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_notify<'life0, 'async_trait>(
&'life0 self,
__arg1: ListenerId,
scope: Scope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_subscribe_command<'life0, 'async_trait>(
&'life0 self,
id: ListenerId,
scope: Scope,
command: Command,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<N> Freeze for Root<N>
impl<N> !RefUnwindSafe for Root<N>
impl<N> Send for Root<N>
impl<N> Sync for Root<N>
impl<N> Unpin for Root<N>
impl<N> !UnwindSafe for Root<N>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
Source§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere
T: Any + 'static,
Source§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any, which is backed by the type implementing this trait.Source§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any, which is backed by the type implementing this trait.Source§impl<T> CastFromSync for T
impl<T> CastFromSync for T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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