Trait ClientContext

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

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

    // Provided method
    fn make_chain_client(
        &self,
        chain_id: ChainId,
    ) -> ChainClient<Self::Environment> { ... }
}

Required Associated Types§

Required Methods§

Source

fn wallet(&self) -> &Wallet

Source

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

Source

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

Source

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

Source

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

Provided Methods§

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<Env: Environment, W> ClientContext for ClientContext<Env, W>
where W: Persist<Target = Wallet>,