Trait EthFilterApiServer

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

Returns id of new filter.

Source

fn new_block_filter(&self) -> Result<U256, ErrorObject<'static>>

Returns id of new block filter.

Source

fn new_pending_transaction_filter(&self) -> Result<U256, ErrorObject<'static>>

Returns id of new block filter.

Source

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

Returns filter changes since last poll.

Source

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

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

Source

fn uninstall_filter(&self, index: Index) -> Result<bool, ErrorObject<'static>>

Uninstalls filter.

Source

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

Returns logs matching given filter object.

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§

Source§

impl<B, C, BE, P> EthFilterApiServer for EthFilter<B, C, BE, P>
where B: BlockT, C: ProvideRuntimeApi<B> + HeaderBackend<B> + StorageProvider<B, BE> + 'static, C::Api: EthereumRuntimeRPCApi<B>, BE: Backend<B> + 'static, P: TransactionPool<Block = B, Hash = B::Hash> + 'static,