pub trait StatementApiClient: SubscriptionClientT {
// Provided methods
fn submit<'life0, 'async_trait>(
&'life0 self,
encoded: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SubmitResult, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn subscribe_statement<'life0, 'async_trait>(
&'life0 self,
topic_filter: TopicFilter,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StatementEvent>, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Client implementation for the StatementApi RPC API.
Provided Methods§
Sourcefn submit<'life0, 'async_trait>(
&'life0 self,
encoded: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SubmitResult, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn submit<'life0, 'async_trait>(
&'life0 self,
encoded: Bytes,
) -> Pin<Box<dyn Future<Output = Result<SubmitResult, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Submit a SCALE-encoded statement.
See Statement definition for more details.
Returns SubmitResult indicating success or failure reason.
Sourcefn subscribe_statement<'life0, 'async_trait>(
&'life0 self,
topic_filter: TopicFilter,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StatementEvent>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn subscribe_statement<'life0, 'async_trait>(
&'life0 self,
topic_filter: TopicFilter,
) -> Pin<Box<dyn Future<Output = Result<Subscription<StatementEvent>, Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Subscribe to new statements that match the provided filters.
§Parameters
topic_filter— Which topics to match. UseTopicFilter::Anyto match all topics,TopicFilter::MatchAll(vec)to match statements that include all provided topics, orTopicFilter::MatchAny(vec)to match statements that include any of the provided topics.
§Returns
Returns a stream of StatementEvent values.
When a subscription is initiated the endpoint will first return all matching statements
already in the store in batches as StatementEvent::NewStatements.
NewStatements includes an Optional field remaining which indicates how many more
statements are left to be sent in the initial batch of existing statements. The field
guarantees to the client that it will receive at least this many more statements in the
subscription stream, but it may receive more if new statements are added to the store that
match the filter.
If there are no statements in the store matching the filter, an empty batch of statements is sent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.