pub struct WsSubscription {
pub blocks: bool,
pub mempool_info: bool,
pub fees: bool,
pub addresses: HashSet<String>,
pub transactions: HashSet<String>,
}Expand description
WebSocket subscription configuration.
Fields§
§blocks: boolSubscribe to new blocks
mempool_info: boolSubscribe to mempool info updates
fees: boolSubscribe to fee updates
addresses: HashSet<String>Addresses to track
transactions: HashSet<String>Transactions to track
Implementations§
Source§impl WsSubscription
impl WsSubscription
Sourcepub fn with_blocks(self) -> Self
pub fn with_blocks(self) -> Self
Subscribe to new blocks.
Sourcepub fn with_mempool_info(self) -> Self
pub fn with_mempool_info(self) -> Self
Subscribe to mempool info.
Sourcepub fn track_address(self, address: impl Into<String>) -> Self
pub fn track_address(self, address: impl Into<String>) -> Self
Track an address.
Sourcepub fn track_addresses(
self,
addresses: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn track_addresses( self, addresses: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Track multiple addresses.
Sourcepub fn track_transaction(self, txid: impl Into<String>) -> Self
pub fn track_transaction(self, txid: impl Into<String>) -> Self
Track a transaction.
Sourcepub fn has_subscriptions(&self) -> bool
pub fn has_subscriptions(&self) -> bool
Check if any subscriptions are active.
Trait Implementations§
Source§impl Clone for WsSubscription
impl Clone for WsSubscription
Source§fn clone(&self) -> WsSubscription
fn clone(&self) -> WsSubscription
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 WsSubscription
impl Debug for WsSubscription
Source§impl Default for WsSubscription
impl Default for WsSubscription
Source§fn default() -> WsSubscription
fn default() -> WsSubscription
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WsSubscription
impl RefUnwindSafe for WsSubscription
impl Send for WsSubscription
impl Sync for WsSubscription
impl Unpin for WsSubscription
impl UnwindSafe for WsSubscription
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