pub struct ReputationChangeWeights {
pub bad_message: Reputation,
pub bad_block: Reputation,
pub bad_transactions: Reputation,
pub already_seen_transactions: Reputation,
pub timeout: Reputation,
pub bad_protocol: Reputation,
pub failed_to_connect: Reputation,
pub dropped: Reputation,
pub bad_announcement: Reputation,
}Expand description
How the ReputationChangeKind are weighted.
Fields§
§bad_message: ReputationWeight for ReputationChangeKind::BadMessage
bad_block: ReputationWeight for ReputationChangeKind::BadBlock
bad_transactions: ReputationWeight for ReputationChangeKind::BadTransactions
already_seen_transactions: ReputationWeight for ReputationChangeKind::AlreadySeenTransaction
timeout: ReputationWeight for ReputationChangeKind::Timeout
bad_protocol: ReputationWeight for ReputationChangeKind::BadProtocol
failed_to_connect: ReputationWeight for ReputationChangeKind::FailedToConnect
dropped: ReputationWeight for ReputationChangeKind::Dropped
bad_announcement: ReputationWeight for ReputationChangeKind::BadAnnouncement
Implementations§
Source§impl ReputationChangeWeights
impl ReputationChangeWeights
Sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Creates a new instance that doesn’t penalize any kind of reputation change.
Sourcepub fn change(&self, kind: ReputationChangeKind) -> ReputationChange
pub fn change(&self, kind: ReputationChangeKind) -> ReputationChange
Returns the quantifiable ReputationChange for the given ReputationChangeKind using
the configured weights
Trait Implementations§
Source§impl Clone for ReputationChangeWeights
impl Clone for ReputationChangeWeights
Source§fn clone(&self) -> ReputationChangeWeights
fn clone(&self) -> ReputationChangeWeights
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReputationChangeWeights
impl Debug for ReputationChangeWeights
Source§impl Default for ReputationChangeWeights
impl Default for ReputationChangeWeights
Source§impl<'de> Deserialize<'de> for ReputationChangeWeightswhere
ReputationChangeWeights: Default,
impl<'de> Deserialize<'de> for ReputationChangeWeightswhere
ReputationChangeWeights: Default,
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>,
Source§impl PartialEq for ReputationChangeWeights
impl PartialEq for ReputationChangeWeights
Source§impl Serialize for ReputationChangeWeights
impl Serialize for ReputationChangeWeights
impl Eq for ReputationChangeWeights
impl StructuralPartialEq for ReputationChangeWeights
Auto Trait Implementations§
impl Freeze for ReputationChangeWeights
impl RefUnwindSafe for ReputationChangeWeights
impl Send for ReputationChangeWeights
impl Sync for ReputationChangeWeights
impl Unpin for ReputationChangeWeights
impl UnwindSafe for ReputationChangeWeights
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 36 bytes