pub struct Checksum { /* private fields */ }Expand description
One published checksum.
Implementations§
Source§impl Checksum
impl Checksum
Sourcepub fn new(
algorithm: ChecksumAlgorithm,
hex_value: &str,
) -> Result<Self, ModelError>
pub fn new( algorithm: ChecksumAlgorithm, hex_value: &str, ) -> Result<Self, ModelError>
Validate algType and lowercase algValue.
Known algorithms must use their digest length. Unrecognized algorithms keep the hex string when it matches the schema length bounds.
§Errors
Returns an error when the hex spelling or length is not allowed.
Sourcepub fn algorithm(&self) -> &ChecksumAlgorithm
pub fn algorithm(&self) -> &ChecksumAlgorithm
Algorithm.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Checksum
impl<'de> Deserialize<'de> for Checksum
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Checksum
impl StructuralPartialEq for Checksum
Auto Trait Implementations§
impl Forget for Checksum
impl Freeze for Checksum
impl Move for Checksum
impl RefUnwindSafe for Checksum
impl Send for Checksum
impl Sync for Checksum
impl Unpin for Checksum
impl UnsafeUnpin for Checksum
impl UnwindSafe for Checksum
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