Trait ClientContext

Source
pub trait ClientContext: Send + Sync {
    type Environment: Environment;

    // Required methods
    fn wallet(&self) -> &<Self::Environment as Environment>::Wallet;
    fn storage(&self) -> &<Self::Environment as Environment>::Storage;
    fn client(&self) -> &Arc<Client<Self::Environment>>;
    fn timing_sender(&self) -> Option<UnboundedSender<(u64, TimingType)>>;
    fn update_wallet_for_new_chain(
        &mut self,
        chain_id: ChainId,
        owner: Option<AccountOwner>,
        timestamp: Timestamp,
        epoch: Epoch,
    ) -> impl Future<Output = Result<(), Error>> + Send + Sync;
    fn update_wallet(
        &mut self,
        client: &ChainClient<<Self as ClientContext>::Environment>,
    ) -> impl Future<Output = Result<(), Error>> + Send + Sync;

    // Provided methods
    fn admin_chain(&self) -> ChainId { ... }
    fn make_chain_client(
        &self,
        chain_id: ChainId,
    ) -> impl Future<Output = Result<ChainClient<Self::Environment>, Error>> + Send + Sync { ... }
}

Required Associated Types§

Required Methods§

Source

fn wallet(&self) -> &<Self::Environment as Environment>::Wallet

Source

fn storage(&self) -> &<Self::Environment as Environment>::Storage

Source

fn client(&self) -> &Arc<Client<Self::Environment>>

Source

fn timing_sender(&self) -> Option<UnboundedSender<(u64, TimingType)>>

Gets the timing sender for benchmarking, if available.

Source

fn update_wallet_for_new_chain( &mut self, chain_id: ChainId, owner: Option<AccountOwner>, timestamp: Timestamp, epoch: Epoch, ) -> impl Future<Output = Result<(), Error>> + Send + Sync

Source

fn update_wallet( &mut self, client: &ChainClient<<Self as ClientContext>::Environment>, ) -> impl Future<Output = Result<(), Error>> + Send + Sync

Provided Methods§

Source

fn admin_chain(&self) -> ChainId

Source

fn make_chain_client( &self, chain_id: ChainId, ) -> impl Future<Output = Result<ChainClient<Self::Environment>, Error>> + Send + Sync

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§