Trait EthFilterApiServer

Source
pub trait EthFilterApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn new_filter<'life0, 'async_trait>(
        &'life0 self,
        filter: Filter,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn new_block_filter<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn new_pending_transaction_filter<'life0, 'async_trait>(
        &'life0 self,
        full: Option<bool>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn uninstall_filter<'life0, 'async_trait>(
        &'life0 self,
        filter_id: Index,
    ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn filter_changes<'life0, 'async_trait>(
        &'life0 self,
        filter_id: Index,
    ) -> Pin<Box<dyn Future<Output = RpcResult<FilterChanges>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn filter_logs<'life0, 'async_trait>(
        &'life0 self,
        filter_id: Index,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Log>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn logs<'life0, 'async_trait>(
        &'life0 self,
        filter: Filter,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Log>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the EthFilterApi RPC API.

Required Methods§

Source

fn new_filter<'life0, 'async_trait>( &'life0 self, filter: Filter, ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a filter object, based on filter options, to notify when the state changes (logs).

Source

fn new_block_filter<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a filter in the node, to notify when a new block arrives.

Source

fn new_pending_transaction_filter<'life0, 'async_trait>( &'life0 self, full: Option<bool>, ) -> Pin<Box<dyn Future<Output = RpcResult<U256>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a filter in the node, to notify when new pending transactions arrive.

Source

fn uninstall_filter<'life0, 'async_trait>( &'life0 self, filter_id: Index, ) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Uninstalls a filter with given id.

Source

fn filter_changes<'life0, 'async_trait>( &'life0 self, filter_id: Index, ) -> Pin<Box<dyn Future<Output = RpcResult<FilterChanges>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Polling method for a filter, which returns an array of logs which occurred since last poll.

Source

fn filter_logs<'life0, 'async_trait>( &'life0 self, filter_id: Index, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Log>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns an array of all logs matching filter with given id.

Source

fn logs<'life0, 'async_trait>( &'life0 self, filter: Filter, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Log>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns an array of all logs matching filter with given id.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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.

Implementors§