pub struct NetworkParameters {
pub magic_bytes: [u8; 4],
pub default_port: u16,
pub genesis_block: Block,
pub max_target: u32,
pub halving_interval: u64,
pub network_name: String,
pub is_testnet: bool,
}Expand description
Network parameters for different Bitcoin variants
Fields§
§magic_bytes: [u8; 4]Network magic bytes for P2P protocol
default_port: u16Default P2P port
genesis_block: BlockGenesis block for this network
max_target: u32Maximum proof-of-work target
halving_interval: u64Block subsidy halving interval
network_name: StringNetwork name for identification
is_testnet: boolWhether this is a test network
Implementations§
Source§impl NetworkParameters
impl NetworkParameters
Sourcepub fn from_constants(constants: &NetworkConstants) -> Result<Self>
pub fn from_constants(constants: &NetworkConstants) -> Result<Self>
Create network parameters from constants
Source§impl NetworkParameters
impl NetworkParameters
Sourcepub fn for_version(version: ProtocolVersion) -> Result<Self>
pub fn for_version(version: ProtocolVersion) -> Result<Self>
Create network parameters for a specific protocol version
Trait Implementations§
Source§impl Clone for NetworkParameters
impl Clone for NetworkParameters
Source§fn clone(&self) -> NetworkParameters
fn clone(&self) -> NetworkParameters
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkParameters
impl Debug for NetworkParameters
Source§impl<'de> Deserialize<'de> for NetworkParameters
impl<'de> Deserialize<'de> for NetworkParameters
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
Source§impl PartialEq for NetworkParameters
impl PartialEq for NetworkParameters
Source§fn eq(&self, other: &NetworkParameters) -> bool
fn eq(&self, other: &NetworkParameters) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NetworkParameters
impl Serialize for NetworkParameters
impl Eq for NetworkParameters
impl StructuralPartialEq for NetworkParameters
Auto Trait Implementations§
impl Freeze for NetworkParameters
impl RefUnwindSafe for NetworkParameters
impl Send for NetworkParameters
impl Sync for NetworkParameters
impl Unpin for NetworkParameters
impl UnsafeUnpin for NetworkParameters
impl UnwindSafe for NetworkParameters
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more