pub struct SubscriptionManager { /* private fields */ }Expand description
Subscription manager for real-time updates.
Implementations§
Source§impl SubscriptionManager
impl SubscriptionManager
Sourcepub async fn new(config: ClientConfig) -> Result<Self>
pub async fn new(config: ClientConfig) -> Result<Self>
Create a new subscription manager.
Sourcepub fn subscribe(&self) -> Receiver<SubscriptionEvent>
pub fn subscribe(&self) -> Receiver<SubscriptionEvent>
Subscribe to receive events.
Sourcepub async fn subscribe_address(&self, address: &str) -> Result<Option<String>>
pub async fn subscribe_address(&self, address: &str) -> Result<Option<String>>
Subscribe to address status changes.
Returns the current status hash (or None if no history).
Sourcepub async fn unsubscribe_address(&self, address: &str) -> Result<bool>
pub async fn unsubscribe_address(&self, address: &str) -> Result<bool>
Unsubscribe from address status changes.
Sourcepub async fn subscribe_headers(&self) -> Result<BlockHeaderEvent>
pub async fn subscribe_headers(&self) -> Result<BlockHeaderEvent>
Subscribe to new block headers.
Returns the current tip header.
Sourcepub async fn subscribed_addresses(&self) -> Vec<String>
pub async fn subscribed_addresses(&self) -> Vec<String>
Get all subscribed addresses.
Sourcepub async fn is_headers_subscribed(&self) -> bool
pub async fn is_headers_subscribed(&self) -> bool
Check if headers subscription is active.
Sourcepub async fn subscription_count(&self) -> usize
pub async fn subscription_count(&self) -> usize
Get subscription count.
Sourcepub async fn process_notification(
&self,
method: &str,
params: &[Value],
) -> Result<()>
pub async fn process_notification( &self, method: &str, params: &[Value], ) -> Result<()>
Process a notification from the server.
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if the manager is running.
Auto Trait Implementations§
impl !Freeze for SubscriptionManager
impl !RefUnwindSafe for SubscriptionManager
impl Send for SubscriptionManager
impl Sync for SubscriptionManager
impl Unpin for SubscriptionManager
impl !UnwindSafe for SubscriptionManager
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