pub struct Digest(/* private fields */);Expand description
The identity of some bytes, written as sha256: and hex.
The prefix is not decoration: it is what allows another algorithm the day one is needed without every stored name becoming ambiguous.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn parse(text: impl Into<String>) -> Self
pub fn parse(text: impl Into<String>) -> Self
A digest someone else computed — the id of an artifact, a key read back from a record.
Sourcepub fn path(&self) -> (String, String)
pub fn path(&self) -> (String, String)
How it is split into a directory and a file, so no directory ends up with
a million entries. The directory comes from the hash and not the whole
string — every digest starts sha256:, and they would all land in one
sh/. Public because a directory and a bucket lay bytes out the same way,
which is what lets one be copied into the other.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Digest
impl Ord for Digest
Source§impl PartialOrd for Digest
impl PartialOrd for Digest
impl Eq for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
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