mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Add missing docs to sr-primitives. (#1531)
This commit is contained in:
committed by
Bastian Köcher
parent
cff0387af0
commit
2c3c4ac0e8
@@ -23,9 +23,11 @@ use traits::{self, Member, DigestItem as DigestItemT, MaybeHash};
|
||||
|
||||
use substrate_primitives::hash::H512 as Signature;
|
||||
|
||||
/// Generic header digest.
|
||||
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, Serialize))]
|
||||
pub struct Digest<Item> {
|
||||
/// A list of logs in the digest.
|
||||
pub logs: Vec<Item>,
|
||||
}
|
||||
|
||||
@@ -175,6 +177,7 @@ impl<Hash: Decode, AuthorityId: Decode> Decode for DigestItem<Hash, AuthorityId>
|
||||
}
|
||||
|
||||
impl<'a, Hash: Codec + Member, AuthorityId: Codec + Member> DigestItemRef<'a, Hash, AuthorityId> {
|
||||
/// Cast this digest item into `AuthoritiesChange`.
|
||||
pub fn as_authorities_change(&self) -> Option<&'a [AuthorityId]> {
|
||||
match *self {
|
||||
DigestItemRef::AuthoritiesChange(ref authorities) => Some(authorities),
|
||||
@@ -182,6 +185,7 @@ impl<'a, Hash: Codec + Member, AuthorityId: Codec + Member> DigestItemRef<'a, Ha
|
||||
}
|
||||
}
|
||||
|
||||
/// Cast this digest item into `ChangesTrieRoot`.
|
||||
pub fn as_changes_trie_root(&self) -> Option<&'a Hash> {
|
||||
match *self {
|
||||
DigestItemRef::ChangesTrieRoot(ref changes_trie_root) => Some(changes_trie_root),
|
||||
|
||||
Reference in New Issue
Block a user