pub struct NotifyController { /* private fields */ }Expand description
Controller for the notification service.
Provides methods to subscribe to various blockchain events and notify subscribers of new blocks, transactions, and network alerts.
Implementations§
Source§impl NotifyController
impl NotifyController
Sourcepub async fn subscribe_new_block<S: ToString>(
&self,
name: S,
) -> Receiver<BlockView>
pub async fn subscribe_new_block<S: ToString>( &self, name: S, ) -> Receiver<BlockView>
Subscribes to new block notifications with the given name.
Returns a receiver channel that will receive new block events.
Sourcepub async fn watch_new_block<S: ToString>(&self, name: S) -> Receiver<Byte32>
pub async fn watch_new_block<S: ToString>(&self, name: S) -> Receiver<Byte32>
watch new block notify
Sourcepub fn notify_new_block(&self, block: BlockView)
pub fn notify_new_block(&self, block: BlockView)
Notifies all subscribers of a new block.
Sourcepub async fn subscribe_new_transaction<S: ToString>(
&self,
name: S,
) -> Receiver<PoolTransactionEntry>
pub async fn subscribe_new_transaction<S: ToString>( &self, name: S, ) -> Receiver<PoolTransactionEntry>
Subscribes to new transaction notifications with the given name.
Returns a receiver channel that will receive new transaction events from the transaction pool.
Sourcepub fn notify_new_transaction(&self, tx_entry: PoolTransactionEntry)
pub fn notify_new_transaction(&self, tx_entry: PoolTransactionEntry)
Notifies all subscribers of a new transaction in the transaction pool.
Sourcepub async fn subscribe_proposed_transaction<S: ToString>(
&self,
name: S,
) -> Receiver<PoolTransactionEntry>
pub async fn subscribe_proposed_transaction<S: ToString>( &self, name: S, ) -> Receiver<PoolTransactionEntry>
Subscribes to proposed transaction notifications with the given name.
Returns a receiver channel that will receive proposed transaction events.
Sourcepub fn notify_proposed_transaction(&self, tx_entry: PoolTransactionEntry)
pub fn notify_proposed_transaction(&self, tx_entry: PoolTransactionEntry)
Notifies all subscribers of a proposed transaction.
Sourcepub async fn subscribe_reject_transaction<S: ToString>(
&self,
name: S,
) -> Receiver<(PoolTransactionEntry, Reject)>
pub async fn subscribe_reject_transaction<S: ToString>( &self, name: S, ) -> Receiver<(PoolTransactionEntry, Reject)>
Subscribes to rejected transaction notifications with the given name.
Returns a receiver channel that will receive rejected transaction events.
Sourcepub fn notify_reject_transaction(
&self,
tx_entry: PoolTransactionEntry,
reject: Reject,
)
pub fn notify_reject_transaction( &self, tx_entry: PoolTransactionEntry, reject: Reject, )
Notifies all subscribers of a rejected transaction.
Sourcepub async fn subscribe_network_alert<S: ToString>(
&self,
name: S,
) -> Receiver<Alert>
pub async fn subscribe_network_alert<S: ToString>( &self, name: S, ) -> Receiver<Alert>
Subscribes to network alert notifications with the given name.
Returns a receiver channel that will receive network alert events.
Sourcepub fn notify_network_alert(&self, alert: Alert)
pub fn notify_network_alert(&self, alert: Alert)
Notifies all subscribers of a network alert.
Trait Implementations§
Source§impl Clone for NotifyController
impl Clone for NotifyController
Source§fn clone(&self) -> NotifyController
fn clone(&self) -> NotifyController
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for NotifyController
impl !RefUnwindSafe for NotifyController
impl Send for NotifyController
impl Sync for NotifyController
impl Unpin for NotifyController
impl !UnwindSafe for NotifyController
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
§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)
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>
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>
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