Struct iota_client::block::protocol::ProtocolParameters
source · pub struct ProtocolParameters { /* private fields */ }
Expand description
Defines the parameters of the protocol.
Implementations§
source§impl ProtocolParameters
impl ProtocolParameters
sourcepub fn new(
protocol_version: u8,
network_name: String,
bech32_hrp: String,
min_pow_score: u32,
below_max_depth: u8,
rent_structure: RentStructure,
token_supply: u64
) -> Result<ProtocolParameters, Error>
pub fn new(
protocol_version: u8,
network_name: String,
bech32_hrp: String,
min_pow_score: u32,
below_max_depth: u8,
rent_structure: RentStructure,
token_supply: u64
) -> Result<ProtocolParameters, Error>
Creates a new ProtocolParameters
.
sourcepub fn protocol_version(&self) -> u8
pub fn protocol_version(&self) -> u8
Returns the protocol version of the ProtocolParameters
.
sourcepub fn network_name(&self) -> &str
pub fn network_name(&self) -> &str
Returns the network name of the ProtocolParameters
.
sourcepub fn network_id(&self) -> u64
pub fn network_id(&self) -> u64
Returns the network ID of the ProtocolParameters
.
sourcepub fn bech32_hrp(&self) -> &str
pub fn bech32_hrp(&self) -> &str
Returns the bech32 HRP of the ProtocolParameters
.
sourcepub fn min_pow_score(&self) -> u32
pub fn min_pow_score(&self) -> u32
Returns the minimum PoW score of the ProtocolParameters
.
sourcepub fn below_max_depth(&self) -> u8
pub fn below_max_depth(&self) -> u8
Returns the below max depth of the ProtocolParameters
.
sourcepub fn rent_structure(&self) -> &RentStructure
pub fn rent_structure(&self) -> &RentStructure
Returns the rent structure of the ProtocolParameters
.
sourcepub fn token_supply(&self) -> u64
pub fn token_supply(&self) -> u64
Returns the token supply of the ProtocolParameters
.
Trait Implementations§
source§impl Borrow<()> for ProtocolParameters
impl Borrow<()> for ProtocolParameters
source§impl Clone for ProtocolParameters
impl Clone for ProtocolParameters
source§fn clone(&self) -> ProtocolParameters
fn clone(&self) -> ProtocolParameters
Returns a copy of the value. Read more
1.0.0 · 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 ProtocolParameters
impl Debug for ProtocolParameters
source§impl Default for ProtocolParameters
impl Default for ProtocolParameters
source§fn default() -> ProtocolParameters
fn default() -> ProtocolParameters
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ProtocolParameters
impl<'de> Deserialize<'de> for ProtocolParameters
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ProtocolParameters, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ProtocolParameters, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for ProtocolParameters
impl Ord for ProtocolParameters
source§fn cmp(&self, other: &ProtocolParameters) -> Ordering
fn cmp(&self, other: &ProtocolParameters) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl Packable for ProtocolParameters
impl Packable for ProtocolParameters
§type UnpackError = Error
type UnpackError = Error
The error type that can be returned if some semantic error occurs while unpacking. Read more
§type UnpackVisitor = <u8 as Packable>::UnpackVisitor
type UnpackVisitor = <u8 as Packable>::UnpackVisitor
FIXME: docs
source§fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
Packs this value into the given
Packer
.source§fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<ProtocolParameters as Packable>::UnpackVisitor
) -> Result<ProtocolParameters, UnpackError<<ProtocolParameters as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<ProtocolParameters as Packable>::UnpackVisitor
) -> Result<ProtocolParameters, UnpackError<<ProtocolParameters as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
Unpacks this value from the given
Unpacker
. The VERIFY
generic parameter can be used to skip additional
syntactic checks.source§impl PartialEq<ProtocolParameters> for ProtocolParameters
impl PartialEq<ProtocolParameters> for ProtocolParameters
source§fn eq(&self, other: &ProtocolParameters) -> bool
fn eq(&self, other: &ProtocolParameters) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ProtocolParameters> for ProtocolParameters
impl PartialOrd<ProtocolParameters> for ProtocolParameters
source§fn partial_cmp(&self, other: &ProtocolParameters) -> Option<Ordering>
fn partial_cmp(&self, other: &ProtocolParameters) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ProtocolParameters
impl Serialize for ProtocolParameters
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<ProtocolParametersDto> for ProtocolParameters
impl TryFrom<ProtocolParametersDto> for ProtocolParameters
source§fn try_from(
value: ProtocolParametersDto
) -> Result<ProtocolParameters, <ProtocolParameters as TryFrom<ProtocolParametersDto>>::Error>
fn try_from(
value: ProtocolParametersDto
) -> Result<ProtocolParameters, <ProtocolParameters as TryFrom<ProtocolParametersDto>>::Error>
Performs the conversion.
impl Eq for ProtocolParameters
impl StructuralEq for ProtocolParameters
impl StructuralPartialEq for ProtocolParameters
Auto Trait Implementations§
impl RefUnwindSafe for ProtocolParameters
impl Send for ProtocolParameters
impl Sync for ProtocolParameters
impl Unpin for ProtocolParameters
impl UnwindSafe for ProtocolParameters
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
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<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<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
source§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
Unpacks this value from a type that implements [AsRef<[u8]>
].
source§fn unpack_unverified<T>(
bytes: T
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
fn unpack_unverified<T>(
bytes: T
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>where
T: AsRef<[u8]>,
Unpacks this value from a type that implements [AsRef<[u8]>
] skipping some syntatical checks.
source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
Returns the length in bytes of the value after being packed. The returned value always matches the number of
bytes written using
pack
.