Struct sn_routing::SectionProofChain[][src]

pub struct SectionProofChain { /* fields omitted */ }

Chain of section BLS keys where every key is proven (signed) by the previous key, except the first one.

Implementations

impl SectionProofChain[src]

pub fn new(first: PublicKey) -> Self[src]

Creates new chain consisting of only one block.

pub fn first_key(&self) -> &PublicKey[src]

Returns the first key of the chain.

pub fn last_key(&self) -> &PublicKey[src]

Returns the last key of the chain.

pub fn keys(&self) -> impl DoubleEndedIterator<Item = &PublicKey>[src]

Returns all the keys of the chain as a DoubleEndedIterator.

pub fn has_key(&self, key: &PublicKey) -> bool[src]

Returns whether this chain contains the given key.

pub fn index_of(&self, key: &PublicKey) -> Option<u64>[src]

Returns the index of the key in the chain or None if not present in the chain.

pub fn slice<B: RangeBounds<u64>>(&self, range: B) -> Self[src]

Returns a subset of this chain specified by the given index range.

Note: unlike std::slice, if the range is invalid or out of bounds, it is silently adjusted to the nearest valid range and so this function never panics.

pub fn len(&self) -> usize[src]

Number of blocks in the chain (including the first block)

pub fn last_key_index(&self) -> u64[src]

Index of the last key in the chain.

pub fn self_verify(&self) -> bool[src]

Check that all the blocks in the chain except the first one have valid signatures. The first one cannot be verified and requires matching against already trusted keys. Thus this function alone cannot be used to determine whether this chain is trusted. Use check_trust for that.

pub fn check_trust<'a, I>(&self, trusted_keys: I) -> TrustStatus where
    I: IntoIterator<Item = &'a PublicKey>, 
[src]

Verify this proof chain against the given trusted keys.

Trait Implementations

impl Clone for SectionProofChain[src]

impl Debug for SectionProofChain[src]

impl<'de> Deserialize<'de> for SectionProofChain[src]

impl Eq for SectionProofChain[src]

impl Hash for SectionProofChain[src]

impl PartialEq<SectionProofChain> for SectionProofChain[src]

impl Serialize for SectionProofChain[src]

impl StructuralEq for SectionProofChain[src]

impl StructuralPartialEq for SectionProofChain[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Member for T where
    T: Clone + Eq + Hash

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,