pub struct EventsClient { /* private fields */ }Expand description
Client for subscribing to and streaming GolemBase events from the blockchain. Provides methods to connect to a node and receive event streams for entity changes.
Implementations§
Source§impl EventsClient
impl EventsClient
Sourcepub async fn new(url: Url) -> Result<Self>
pub async fn new(url: Url) -> Result<Self>
Creates a new EventsClient by connecting to the given websocket Url.
Establishes a connection to the blockchain node for event streaming.
Sourcepub async fn events_stream<'a>(
&'a self,
) -> Result<Pin<Box<dyn Stream<Item = Result<Event>> + Send + 'a>>>
pub async fn events_stream<'a>( &'a self, ) -> Result<Pin<Box<dyn Stream<Item = Result<Event>> + Send + 'a>>>
Listens for GolemBase events from the blockchain, starting from the latest block.
Returns a stream of parsed Event items that can be processed asynchronously.
Sourcepub async fn events_stream_from_block<'a>(
&'a self,
block: u64,
) -> Result<Pin<Box<dyn Stream<Item = Result<Event>> + Send + 'a>>>
pub async fn events_stream_from_block<'a>( &'a self, block: u64, ) -> Result<Pin<Box<dyn Stream<Item = Result<Event>> + Send + 'a>>>
Listens for GolemBase events starting from a specific block number.
Returns a stream of parsed Event items from the given block onward.
§Arguments
block- The block number to start listening for events from.
Auto Trait Implementations§
impl Freeze for EventsClient
impl !RefUnwindSafe for EventsClient
impl Send for EventsClient
impl Sync for EventsClient
impl Unpin for EventsClient
impl !UnwindSafe for EventsClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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