pub struct GraphHash(pub [u8; 32]);Expand description
32-byte BLAKE3 content hash. The canonical identity of every graph in the store.
Carries rkyv Archive derives so wire types in sui-protocol
(and any future archived form referring to a stored blob) can embed
it cheaply. The archived form is a fixed-32-byte fixed-layout, so
zero-copy reads of a GraphHash are a literal pointer offset.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl GraphHash
impl GraphHash
Sourcepub fn of(bytes: &[u8]) -> Self
pub fn of(bytes: &[u8]) -> Self
Compute the BLAKE3 of an arbitrary byte slice. This is the canonical “what’s the hash of these archive bytes” entry point — callers compute it once at archive time and again at retrieve time to verify.
Sourcepub fn as_bytes(&self) -> &[u8; 32]
pub fn as_bytes(&self) -> &[u8; 32]
Raw 32-byte form. Useful when threading into a fixed-width keying surface (redb key, protobuf bytes field, etc.).
Sourcepub fn display_short(&self) -> String
pub fn display_short(&self) -> String
Truncated display form (52 base32 chars, matches Nix store digest length). Used in file names and log lines.
Sourcepub fn shard_prefix(&self) -> (String, String)
pub fn shard_prefix(&self) -> (String, String)
Two-byte/two-byte fan-out prefix for the on-disk path. Returns
(aa, bb) where aa and bb are the first two and second two
hex characters of the hash — chosen so the fan-out spans
256 × 256 = 65 536 leaf directories without ever stat-ing more
than ~16 blobs per leaf (Git’s proven shape).
Trait Implementations§
Source§impl Archive for GraphHash
impl Archive for GraphHash
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedGraphHash
type Archived = ArchivedGraphHash
Source§type Resolver = GraphHashResolver
type Resolver = GraphHashResolver
impl Copy for GraphHash
impl Eq for GraphHash
Source§impl Ord for GraphHash
impl Ord for GraphHash
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for GraphHash
impl PartialOrd for GraphHash
impl StructuralPartialEq for GraphHash
Auto Trait Implementations§
impl Freeze for GraphHash
impl RefUnwindSafe for GraphHash
impl Send for GraphHash
impl Sync for GraphHash
impl Unpin for GraphHash
impl UnsafeUnpin for GraphHash
impl UnwindSafe for GraphHash
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.