Enum bdk::blockchain::any::AnyBlockchain
source · pub enum AnyBlockchain {
Electrum(Box<ElectrumBlockchain>),
Esplora(Box<EsploraBlockchain>),
CompactFilters(Box<CompactFiltersBlockchain>),
Rpc(Box<RpcBlockchain>),
}
Expand description
Type that can contain any of the Blockchain
types defined by the library
It allows switching backend at runtime
See this module’s documentation for a usage example.
Variants
Electrum(Box<ElectrumBlockchain>)
Available on crate feature
electrum
only.Electrum client
Esplora(Box<EsploraBlockchain>)
Available on crate feature
esplora
only.Esplora client
CompactFilters(Box<CompactFiltersBlockchain>)
Available on crate feature
compact_filters
only.Compact filters client
Rpc(Box<RpcBlockchain>)
Available on crate feature
rpc
only.RPC client
Trait Implementations
sourceimpl Blockchain for AnyBlockchain
impl Blockchain for AnyBlockchain
sourcefn get_capabilities(&self) -> HashSet<Capability>
fn get_capabilities(&self) -> HashSet<Capability>
Return the set of
Capability
supported by this backendsourceimpl ConfigurableBlockchain for AnyBlockchain
impl ConfigurableBlockchain for AnyBlockchain
type Config = AnyBlockchainConfig
type Config = AnyBlockchainConfig
Type that contains the configuration
sourcefn from_config(config: &Self::Config) -> Result<Self, Error>
fn from_config(config: &Self::Config) -> Result<Self, Error>
Create a new instance given a configuration
sourceimpl From<CompactFiltersBlockchain> for AnyBlockchain
impl From<CompactFiltersBlockchain> for AnyBlockchain
sourcefn from(inner: CompactFiltersBlockchain) -> Self
fn from(inner: CompactFiltersBlockchain) -> Self
Converts to this type from the input type.
sourceimpl From<ElectrumBlockchain> for AnyBlockchain
impl From<ElectrumBlockchain> for AnyBlockchain
sourcefn from(inner: ElectrumBlockchain) -> Self
fn from(inner: ElectrumBlockchain) -> Self
Converts to this type from the input type.
sourceimpl From<EsploraBlockchain> for AnyBlockchain
impl From<EsploraBlockchain> for AnyBlockchain
sourcefn from(inner: EsploraBlockchain) -> Self
fn from(inner: EsploraBlockchain) -> Self
Converts to this type from the input type.
sourceimpl From<RpcBlockchain> for AnyBlockchain
impl From<RpcBlockchain> for AnyBlockchain
sourcefn from(inner: RpcBlockchain) -> Self
fn from(inner: RpcBlockchain) -> Self
Converts to this type from the input type.
sourceimpl GetBlockHash for AnyBlockchain
impl GetBlockHash for AnyBlockchain
sourceimpl GetHeight for AnyBlockchain
impl GetHeight for AnyBlockchain
sourcefn get_height(&self) -> Result<u32, Error>
fn get_height(&self) -> Result<u32, Error>
Return the current height
sourceimpl GetTx for AnyBlockchain
impl GetTx for AnyBlockchain
sourceimpl WalletSync for AnyBlockchain
impl WalletSync for AnyBlockchain
sourcefn wallet_sync<D: BatchDatabase>(
&self,
database: &mut D,
progress_update: Box<dyn Progress>
) -> Result<(), Error>
fn wallet_sync<D: BatchDatabase>(
&self,
database: &mut D,
progress_update: Box<dyn Progress>
) -> Result<(), Error>
If not overridden, it defaults to calling
Self::wallet_setup
internally. Read moresourcefn wallet_setup<D: BatchDatabase>(
&self,
database: &mut D,
progress_update: Box<dyn Progress>
) -> Result<(), Error>
fn wallet_setup<D: BatchDatabase>(
&self,
database: &mut D,
progress_update: Box<dyn Progress>
) -> Result<(), Error>
Setup the backend and populate the internal database for the first time Read more
Auto Trait Implementations
impl !RefUnwindSafe for AnyBlockchain
impl Send for AnyBlockchain
impl Sync for AnyBlockchain
impl Unpin for AnyBlockchain
impl !UnwindSafe for AnyBlockchain
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more