Enum bitcoin::network::constants::Network[][src]

pub enum Network {
    Bitcoin,
    Testnet,
    Regtest,
}

The cryptocurrency to act on

Variants

Classic Bitcoin

Bitcoin's testnet

Bitcoin's regtest

Methods

impl Network
[src]

Creates a Network from the magic bytes.

Examples

use bitcoin::network::constants::Network;

assert_eq!(Some(Network::Bitcoin), Network::from_magic(0xD9B4BEF9));
assert_eq!(None, Network::from_magic(0xFFFFFFFF));

Return the network magic bytes, which should be encoded little-endian at the start of every message

Examples

use bitcoin::network::constants::Network;

let network = Network::Bitcoin;
assert_eq!(network.magic(), 0xD9B4BEF9);

Trait Implementations

impl Copy for Network
[src]

impl PartialEq for Network
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Network
[src]

impl PartialOrd for Network
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Network
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Clone for Network
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Hash for Network
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Network
[src]

Formats the value using the given formatter. Read more

impl Display for Network
[src]

Formats the value using the given formatter. Read more

impl FromStr for Network
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl<S: SimpleEncoder> ConsensusEncodable<S> for Network
[src]

Encodes the magic bytes of Network.

impl<D: SimpleDecoder> ConsensusDecodable<D> for Network
[src]

Decodes the magic bytes of Network.

Auto Trait Implementations

impl Send for Network

impl Sync for Network