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: Reputation
Weight for ReputationChangeKind::BadMessage
bad_block: Reputation
Weight for ReputationChangeKind::BadBlock
bad_transactions: Reputation
Weight for ReputationChangeKind::BadTransactions
already_seen_transactions: Reputation
Weight for ReputationChangeKind::AlreadySeenTransaction
timeout: Reputation
Weight for ReputationChangeKind::Timeout
bad_protocol: Reputation
Weight for ReputationChangeKind::BadProtocol
failed_to_connect: Reputation
Weight for ReputationChangeKind::FailedToConnect
dropped: Reputation
Weight for ReputationChangeKind::Dropped
bad_announcement: Reputation
Weight for ReputationChangeKind::BadAnnouncement
Implementations§
source§impl ReputationChangeWeights
impl ReputationChangeWeights
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<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