pub struct ContentKey(/* private fields */);Expand description
The key of a file content: the digest of its bytes as read from the working tree. Units derived from a content are keyed by it.
Implementations§
Source§impl ContentKey
impl ContentKey
Sourcepub const fn from_digest(digest: Digest128) -> Self
pub const fn from_digest(digest: Digest128) -> Self
A key read back from storage.
Sourcepub fn stand_in(path: &[u8], evidence: &[u8]) -> Self
pub fn stand_in(path: &[u8], evidence: &[u8]) -> Self
A key for a file whose bytes are not read, such as one over the size limit, derived from its path and stat evidence. It is hashed in its own key-derivation context, so it never equals the key of real bytes, and it changes whenever the evidence does.
pub const fn digest(&self) -> Digest128
Trait Implementations§
Source§impl Clone for ContentKey
impl Clone for ContentKey
impl Copy for ContentKey
Source§impl Debug for ContentKey
impl Debug for ContentKey
Source§impl Display for ContentKey
impl Display for ContentKey
impl Eq for ContentKey
Source§impl Hash for ContentKey
impl Hash for ContentKey
Source§impl HeapBytes for ContentKey
impl HeapBytes for ContentKey
Source§fn heap_bytes(&self, _seen: &mut Seen) -> usize
fn heap_bytes(&self, _seen: &mut Seen) -> usize
The bytes this value owns on the heap; an allocation
seen has
already counted adds nothing.Source§impl Ord for ContentKey
impl Ord for ContentKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ContentKey
impl PartialEq for ContentKey
Source§impl PartialOrd for ContentKey
impl PartialOrd for ContentKey
impl StructuralPartialEq for ContentKey
Auto Trait Implementations§
impl Forget for ContentKey
impl Freeze for ContentKey
impl Move for ContentKey
impl RefUnwindSafe for ContentKey
impl Send for ContentKey
impl Sync for ContentKey
impl Unpin for ContentKey
impl UnsafeUnpin for ContentKey
impl UnwindSafe for ContentKey
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