Skip to main content

ClientContextExt

Trait ClientContextExt 

Source
pub trait ClientContextExt: ClientContext {
    // Provided methods
    async fn clients(
        &self,
    ) -> Result<Vec<ChainClient<<Self as ClientContext>::Environment>>, Error> { ... }
    async fn owners_with_key(
        &self,
        owners: impl IntoIterator<Item = AccountOwner>,
    ) -> Result<BTreeSet<AccountOwner>, Error> { ... }
    async fn unique_owner_with_key(
        &self,
        owners: impl IntoIterator<Item = AccountOwner>,
    ) -> Result<Option<AccountOwner>, Error> { ... }
    async fn maybe_auto_assign_preferred_owner(
        &self,
        chain_client: &mut ChainClient<<Self as ClientContext>::Environment>,
        ownership: &ChainOwnership,
    ) -> Result<(), Error> { ... }
}

Provided Methods§

Source

async fn clients( &self, ) -> Result<Vec<ChainClient<<Self as ClientContext>::Environment>>, Error>

Source

async fn owners_with_key( &self, owners: impl IntoIterator<Item = AccountOwner>, ) -> Result<BTreeSet<AccountOwner>, Error>

Returns the subset of owners for which we have a key pair in the wallet.

Duplicate inputs are treated as one.

Source

async fn unique_owner_with_key( &self, owners: impl IntoIterator<Item = AccountOwner>, ) -> Result<Option<AccountOwner>, Error>

Returns the unique owner from owners for which we have a key pair in the wallet.

Returns None when zero or multiple distinct owners match.

Source

async fn maybe_auto_assign_preferred_owner( &self, chain_client: &mut ChainClient<<Self as ClientContext>::Environment>, ownership: &ChainOwnership, ) -> Result<(), Error>

Sets the preferred owner of chain_client’s chain if the current one is no longer in ownership and we have a key pair for exactly one of the new owners.

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§