pub trait Wallet: Send {
type Error: Error + Send + Sync;
// Required methods
fn get(
&self,
id: ChainId,
) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send;
fn remove(
&self,
id: ChainId,
) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send;
fn items(
&self,
) -> impl Stream<Item = Result<(ChainId, Chain), Self::Error>> + Send;
fn insert(
&self,
id: ChainId,
chain: Chain,
) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send;
fn try_insert(
&self,
id: ChainId,
chain: Chain,
) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send;
fn modify(
&self,
id: ChainId,
f: impl FnMut(&mut Chain) + Send,
) -> impl Future<Output = Result<Option<()>, Self::Error>> + Send;
// Provided methods
fn chain_ids(
&self,
) -> impl Stream<Item = Result<ChainId, Self::Error>> + Send { ... }
fn owned_chain_ids(
&self,
) -> impl Stream<Item = Result<ChainId, Self::Error>> + Send { ... }
}Expand description
A trait for the wallet (i.e. set of chain states) tracked by the client.
Required Associated Types§
Required Methods§
fn get( &self, id: ChainId, ) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send
fn remove( &self, id: ChainId, ) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send
fn items( &self, ) -> impl Stream<Item = Result<(ChainId, Chain), Self::Error>> + Send
fn insert( &self, id: ChainId, chain: Chain, ) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send
fn try_insert( &self, id: ChainId, chain: Chain, ) -> impl Future<Output = Result<Option<Chain>, Self::Error>> + Send
Provided Methods§
fn chain_ids(&self) -> impl Stream<Item = Result<ChainId, Self::Error>> + Send
fn owned_chain_ids( &self, ) -> impl Stream<Item = Result<ChainId, Self::Error>> + Send
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.