[][src]Enum lnpbp::chain::Chain

#[non_exhaustive]
#[repr(u32)]pub enum Chain {
    Mainnet,
    Testnet3,
    Regtest(BlockHash),
    Signet,
    SignetCustom(BlockHash),
    LiquidV1,
    Other(ChainParams),
}

A set of recommended standard networks. Differs from bitcoin::Network in ability to support non-standard and non-predefined networks

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Mainnet

Bitcoin mainnet

Testnet3

Bitcoin testnet version 3

Regtest(BlockHash)

Bitcoin regtest network, with provided genesis hash to distinguish different private networks

Signet

Default bitcoin signet network

SignetCustom(BlockHash)

Some private bitcoin signet network, with provided genesis hash to distinguish private networks from each other

LiquidV1

Liquidv1 sidechain & network by Blockstream

All other networks/chains, providing full information on chain parameters

Implementations

impl Chain[src]

pub fn chain_params(&self) -> ChainParams[src]

Returns chain parameters ChainParams for a given chain id

pub fn as_genesis_hash(&self) -> &BlockHash[src]

Returns hash of genesis block

pub fn from_genesis_hash(hash: &BlockHash) -> Option<Self>[src]

Gueses chain from the given genesis block hash, returning Option::None if the hash is unknown. This implies that for custom signet and some regtest networks with modified genesis the function will fail.

Trait Implementations

impl Clone for Chain[src]

impl Debug for Chain[src]

impl Default for Chain[src]

impl Display for Chain[src]

impl Eq for Chain[src]

impl From<ChainParams> for Chain[src]

impl From<Network> for Chain[src]

impl FromStr for Chain[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for Chain[src]

impl Ord for Chain[src]

impl PartialEq<Chain> for Chain[src]

impl PartialOrd<Chain> for Chain[src]

impl StrictDecode for Chain[src]

impl StrictEncode for Chain[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.