Struct sn_routing::SectionProofChain [−][src]
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]
I: IntoIterator<Item = &'a PublicKey>,
Verify this proof chain against the given trusted keys.
Trait Implementations
impl Clone for SectionProofChain
[src]
fn clone(&self) -> SectionProofChain
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SectionProofChain
[src]
impl<'de> Deserialize<'de> for SectionProofChain
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for SectionProofChain
[src]
impl Hash for SectionProofChain
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SectionProofChain> for SectionProofChain
[src]
fn eq(&self, other: &SectionProofChain) -> bool
[src]
fn ne(&self, other: &SectionProofChain) -> bool
[src]
impl Serialize for SectionProofChain
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for SectionProofChain
[src]
impl StructuralPartialEq for SectionProofChain
[src]
Auto Trait Implementations
impl RefUnwindSafe for SectionProofChain
[src]
impl Send for SectionProofChain
[src]
impl Sync for SectionProofChain
[src]
impl Unpin for SectionProofChain
[src]
impl UnwindSafe for SectionProofChain
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Member for T where
T: Clone + Eq + Hash,
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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,