pub struct TrustConfig {
pub max_delegation_depth: usize,
pub trust_decay: f64,
}Expand description
Delegation-depth and trust-decay policy for chain verification.
Fields§
§max_delegation_depth: usizeMaximum number of delegation hops (edges) allowed on a chain.
trust_decay: f64Multiplicative trust factor applied per hop, in (0.0, 1.0].
Implementations§
Source§impl TrustConfig
impl TrustConfig
Sourcepub fn new(max_delegation_depth: usize, trust_decay: f64) -> Self
pub fn new(max_delegation_depth: usize, trust_decay: f64) -> Self
Create a config with a depth limit and a per-hop decay factor.
§Panics
Panics if trust_decay is not in (0.0, 1.0].
Sourcepub fn effective_trust(&self, base: f64, hops: usize) -> f64
pub fn effective_trust(&self, base: f64, hops: usize) -> f64
Trust score after hops delegation hops from a base score.
Trait Implementations§
Source§impl Clone for TrustConfig
impl Clone for TrustConfig
Source§fn clone(&self) -> TrustConfig
fn clone(&self) -> TrustConfig
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 TrustConfig
impl Debug for TrustConfig
Auto Trait Implementations§
impl Freeze for TrustConfig
impl RefUnwindSafe for TrustConfig
impl Send for TrustConfig
impl Sync for TrustConfig
impl Unpin for TrustConfig
impl UnsafeUnpin for TrustConfig
impl UnwindSafe for TrustConfig
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