pub enum Network {
Mainnet,
Testnet3,
Testnet4,
Regtest,
Signet,
}Expand description
A simple version of bitcoin::Network which impls FromStr and
Display in a consistent way, and which isn’t #[non_exhaustive].
NOTE: bitcoin::Network serializes their mainnet variant as “bitcoin”,
while we serialize it as “mainnet”. Be sure to use our serde impls
when (de)serializing this network.
Variants§
Implementations§
Source§impl Network
impl Network
Sourcepub fn to_bitcoin(self) -> Network
pub fn to_bitcoin(self) -> Network
Convert to a bitcoin::Network.
Equivalent to using the From impl.
pub fn as_str(self) -> &'static str
Sourcepub fn genesis_block_hash(self) -> BlockHash
pub fn genesis_block_hash(self) -> BlockHash
Sourcepub fn genesis_chain_hash(self) -> ChainHash
pub fn genesis_chain_hash(self) -> ChainHash
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Network
impl<'de> Deserialize<'de> for Network
Source§fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Network
impl Eq for Network
impl StructuralPartialEq for Network
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnsafeUnpin for Network
impl UnwindSafe for Network
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more