Skip to main content

EthFilterApiServer

Trait EthFilterApiServer 

Source
pub trait EthFilterApiServer<T: RpcObject, L: RpcObject>:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn new_filter(
        &self,
        filter: Filter,
    ) -> impl Future<Output = RpcResult<FilterId>> + Send;
    fn new_block_filter(
        &self,
    ) -> impl Future<Output = RpcResult<FilterId>> + Send;
    fn new_pending_transaction_filter(
        &self,
        kind: Option<PendingTransactionFilterKind>,
    ) -> impl Future<Output = RpcResult<FilterId>> + Send;
    fn filter_changes(
        &self,
        id: FilterId,
    ) -> impl Future<Output = RpcResult<FilterChanges<T, L>>> + Send;
    fn filter_logs(
        &self,
        id: FilterId,
    ) -> impl Future<Output = RpcResult<Vec<L>>> + Send;
    fn uninstall_filter(
        &self,
        id: FilterId,
    ) -> impl Future<Output = RpcResult<bool>> + Send;
    fn logs(
        &self,
        filter: Filter,
    ) -> impl Future<Output = RpcResult<Vec<L>>> + Send;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self>
       where T: Send + Sync + 'static + Clone + Serialize,
             L: Send + Sync + 'static + Clone + Serialize { ... }
}
Expand description

Server trait implementation for the EthFilterApi RPC API.

Required Methods§

Source

fn new_filter( &self, filter: Filter, ) -> impl Future<Output = RpcResult<FilterId>> + Send

Creates a new filter and returns its id.

Source

fn new_block_filter(&self) -> impl Future<Output = RpcResult<FilterId>> + Send

Creates a new block filter and returns its id.

Source

fn new_pending_transaction_filter( &self, kind: Option<PendingTransactionFilterKind>, ) -> impl Future<Output = RpcResult<FilterId>> + Send

Creates a pending transaction filter and returns its id.

Source

fn filter_changes( &self, id: FilterId, ) -> impl Future<Output = RpcResult<FilterChanges<T, L>>> + Send

Returns all filter changes since last poll.

Source

fn filter_logs( &self, id: FilterId, ) -> impl Future<Output = RpcResult<Vec<L>>> + Send

Returns all logs matching given filter (in a range ‘from’ - ‘to’).

Source

fn uninstall_filter( &self, id: FilterId, ) -> impl Future<Output = RpcResult<bool>> + Send

Uninstalls filter.

Source

fn logs(&self, filter: Filter) -> impl Future<Output = RpcResult<Vec<L>>> + Send

Returns logs matching given filter object.

Provided Methods§

Source

fn into_rpc(self) -> RpcModule<Self>
where T: Send + Sync + 'static + Clone + Serialize, L: Send + Sync + 'static + Clone + Serialize,

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".

Implementors§