Enum bdk::blockchain::any::AnyBlockchainConfig [−][src]
pub enum AnyBlockchainConfig { Electrum(ElectrumBlockchainConfig), Esplora(EsploraBlockchainConfig), CompactFilters(CompactFiltersBlockchainConfig), }
Expand description
Type that can contain any of the blockchain configurations defined by the library
This allows storing a single configuration that can be loaded into an AnyBlockchain
instance. Wallets that plan to offer users the ability to switch blockchain backend at runtime
will find this particularly useful.
This type can be serialized from a JSON object like:
use bdk::blockchain::{electrum::ElectrumBlockchainConfig, AnyBlockchainConfig}; let config: AnyBlockchainConfig = serde_json::from_str( r#"{ "type" : "electrum", "url" : "ssl://electrum.blockstream.info:50002", "retry": 2 }"#, ) .unwrap(); assert_eq!( config, AnyBlockchainConfig::Electrum(ElectrumBlockchainConfig { url: "ssl://electrum.blockstream.info:50002".into(), retry: 2, socks5: None, timeout: None }) );
Variants
Electrum(ElectrumBlockchainConfig)
electrum
only.Electrum client
Esplora(EsploraBlockchainConfig)
esplora
only.Esplora client
CompactFilters(CompactFiltersBlockchainConfig)
compact_filters
only.Compact filters client
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for AnyBlockchainConfig
impl Send for AnyBlockchainConfig
impl Sync for AnyBlockchainConfig
impl Unpin for AnyBlockchainConfig
impl UnwindSafe for AnyBlockchainConfig
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V