pub struct Hash {
    pub algo: Algo,
    pub hash: Vec<u8>,
}Expand description
This element represents a hash of some data, defined by the hash algorithm used and the computed value.
Fields§
§algo: AlgoThe algorithm used to create this hash.
hash: Vec<u8>The hash value, as a vector of bytes.
Implementations§
Source§impl Hash
 
impl Hash
Sourcepub fn new(algo: Algo, hash: Vec<u8>) -> Hash
 
pub fn new(algo: Algo, hash: Vec<u8>) -> Hash
Creates a Hash element with the given algo and data.
Sourcepub fn from_base64(algo: Algo, hash: &str) -> Result<Hash, Error>
 
pub fn from_base64(algo: Algo, hash: &str) -> Result<Hash, Error>
Like new but takes base64-encoded data before decoding it.
Sourcepub fn from_hex(algo: Algo, hex: &str) -> Result<Hash, ParseIntError>
 
pub fn from_hex(algo: Algo, hex: &str) -> Result<Hash, ParseIntError>
Like new but takes hex-encoded data before decoding it.
Sourcepub fn from_colon_separated_hex(
    algo: Algo,
    hex: &str,
) -> Result<Hash, ParseIntError>
 
pub fn from_colon_separated_hex( algo: Algo, hex: &str, ) -> Result<Hash, ParseIntError>
Like new but takes hex-encoded data before decoding it.
Sourcepub fn to_colon_separated_hex(&self) -> String
 
pub fn to_colon_separated_hex(&self) -> String
Formats this hash into colon-separated hexadecimal.
Trait Implementations§
Source§impl AsXml for Hash
 
impl AsXml for Hash
Source§impl FromXml for Hash
 
impl FromXml for Hash
Source§fn from_events(
    name: QName,
    attrs: AttrMap,
    ctx: &Context<'_>,
) -> Result<Self::Builder, FromEventsError>
 
fn from_events( name: QName, attrs: AttrMap, ctx: &Context<'_>, ) -> Result<Self::Builder, FromEventsError>
Attempt to initiate the streamed construction of this struct from XML. Read more
Source§fn xml_name_matcher() -> XmlNameMatcher<'static>
 
fn xml_name_matcher() -> XmlNameMatcher<'static>
Return a predicate which determines if 
Self may be parsed from
a given XML element. Read moreSource§impl TryFrom<Element> for Hash
 
impl TryFrom<Element> for Hash
Source§type Error = FromElementError
 
type Error = FromElementError
The type returned in the event of a conversion error.
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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