pub enum Event {
Response(SatisfiedRequest),
ResponseError(ErroredRequest),
Notification(Notification),
}Expand description
Represents a high-level event produced after processing a server notification or response.
Variants§
Response(SatisfiedRequest)
A successfully satisfied response to a previously tracked request.
Contains the original request and the parsed result.
ResponseError(ErroredRequest)
A failed response to a previously tracked request.
Contains the original request and the error returned by the server.
Notification(Notification)
A server-initiated notification that was not in response to any tracked request.
Typically includes information such as new block headers or script status changes.
Implementations§
Source§impl Event
impl Event
Sourcepub fn try_to_headers(&self) -> Option<Vec<(u32, Header)>>
pub fn try_to_headers(&self) -> Option<Vec<(u32, Header)>>
Attempts to extract block headers from the event, if applicable.
Returns a vector of (height, Header) pairs for events that contain header data, whether
from a response to a request (e.g., blockchain.headers.subscribe) or from a server
notification.
Returns None if the event does not include any header information.