pub struct BlockTx(/* private fields */);
Expand description
Wrapper around watch::Sender
to notify of new blocks.
This is used by essential-builder
to notify essential-relayer
and by essential-relayer
to notify [validation
] stream.
Implementations§
Source§impl BlockTx
impl BlockTx
Sourcepub fn notify(&self)
pub fn notify(&self)
Notify listeners that a new block has been received.
Note this is best effort and will still send even if there are currently no listeners.
Sourcepub fn new_listener(&self) -> BlockRx
pub fn new_listener(&self) -> BlockRx
Create a new BlockRx
to listen for new blocks.
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Get the number of receivers listening for new blocks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockTx
impl !RefUnwindSafe for BlockTx
impl Send for BlockTx
impl Sync for BlockTx
impl Unpin for BlockTx
impl !UnwindSafe for BlockTx
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