pub struct MetadataDescription<M: Metadata> { /* private fields */ }Expand description
Description of a piece of metadata, used in verification.
Implementations§
Source§impl<M: Metadata> MetadataDescription<M>
impl<M: Metadata> MetadataDescription<M>
Sourcepub fn from_slice(
buf: &[u8],
version: u32,
hash_algs: &[HashAlgorithm],
) -> Result<Self>
pub fn from_slice( buf: &[u8], version: u32, hash_algs: &[HashAlgorithm], ) -> Result<Self>
Create a MetadataDescription from a slice. Size and hashes will be calculated.
Sourcepub fn new(
version: u32,
length: Option<usize>,
hashes: HashMap<HashAlgorithm, HashValue>,
) -> Result<Self>
pub fn new( version: u32, length: Option<usize>, hashes: HashMap<HashAlgorithm, HashValue>, ) -> Result<Self>
Create a new MetadataDescription.
Sourcepub fn hashes(&self) -> &HashMap<HashAlgorithm, HashValue>
pub fn hashes(&self) -> &HashMap<HashAlgorithm, HashValue>
An immutable reference to the hashes of the described metadata.
Trait Implementations§
Source§impl<M: Clone + Metadata> Clone for MetadataDescription<M>
impl<M: Clone + Metadata> Clone for MetadataDescription<M>
Source§fn clone(&self) -> MetadataDescription<M>
fn clone(&self) -> MetadataDescription<M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, M: Metadata> Deserialize<'de> for MetadataDescription<M>
impl<'de, M: Metadata> Deserialize<'de> for MetadataDescription<M>
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<M: Metadata> Serialize for MetadataDescription<M>
impl<M: Metadata> Serialize for MetadataDescription<M>
impl<M: Eq + Metadata> Eq for MetadataDescription<M>
impl<M: Metadata> StructuralPartialEq for MetadataDescription<M>
Auto Trait Implementations§
impl<M> Freeze for MetadataDescription<M>
impl<M> RefUnwindSafe for MetadataDescription<M>where
M: RefUnwindSafe,
impl<M> Send for MetadataDescription<M>where
M: Send,
impl<M> Sync for MetadataDescription<M>where
M: Sync,
impl<M> Unpin for MetadataDescription<M>where
M: Unpin,
impl<M> UnsafeUnpin for MetadataDescription<M>
impl<M> UnwindSafe for MetadataDescription<M>where
M: UnwindSafe,
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