pub trait StateServer {
    type InitialState: Serialize;
    type State: DeserializeOwned;

    // Required methods
    fn query_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        initial_state: &'life1 Self::InitialState,
        query_block: impl 'async_trait + Into<QueryBlock> + Send + 'static
    ) -> Pin<Box<dyn Future<Output = Result<BlockState<Self::State>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query_states_since<'life0, 'life1, 'async_trait>(
        &'life0 self,
        initial_state: &'life1 Self::InitialState,
        previous_block_hash: H256,
        depth: usize
    ) -> Pin<Box<dyn Future<Output = Result<StatesSince<Self::State>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn subscribe_states<'life0, 'life1, 'async_trait>(
        &'life0 self,
        initial_state: &'life1 Self::InitialState,
        confirmations: usize
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StateStreamItem<Self::State>>> + Send>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Associated Types§

Required Methods§

source

fn query_state<'life0, 'life1, 'async_trait>( &'life0 self, initial_state: &'life1 Self::InitialState, query_block: impl 'async_trait + Into<QueryBlock> + Send + 'static ) -> Pin<Box<dyn Future<Output = Result<BlockState<Self::State>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn query_states_since<'life0, 'life1, 'async_trait>( &'life0 self, initial_state: &'life1 Self::InitialState, previous_block_hash: H256, depth: usize ) -> Pin<Box<dyn Future<Output = Result<StatesSince<Self::State>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn subscribe_states<'life0, 'life1, 'async_trait>( &'life0 self, initial_state: &'life1 Self::InitialState, confirmations: usize ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StateStreamItem<Self::State>>> + Send>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

source§

impl<I, S> StateServer for GrpcStateFoldClient<I, S>where I: Serialize + Send + Sync, S: DeserializeOwned + Send + Sync,

§

type InitialState = I

§

type State = S