pub struct ContentHash(/* private fields */);Expand description
A SHA-256 package version identity.
Legacy identities cover each module’s logical name and exact .beam bytes
in BeamSet canonical order. Explicit-timeout identities append a
domain-separated timeout encoding. Archive representation and optional
source inclusion never participate, so deterministic inputs keep one version.
“Source inclusion” is EVERY archived-source family, and this is a declared
non-property rather than an accident of the current encoding: neither the
Gleam src/ entries nor the AWL awl/document/ + awl/schema/ entries
(see crate::awl) contribute a byte to any identity above. Two packages
that differ ONLY in whether they carry an authored AWL document, or in what
that document says, are the SAME version — the provenance an archive shows
is declared unbound from identity, never ambiently assumed to be bound.
Pinned by source_inclusion_does_not_change_manifest_version and
awl_source_inclusion_does_not_change_manifest_version in
crate::builder.
Its stable textual form is 64 lowercase hexadecimal characters. That text is
the package version identifier stored in the manifest and the hash component
embedded in namespaced deployed module names; it contains only 0-9a-f,
which is safe for a BEAM module-name component.
Implementations§
Source§impl ContentHash
impl ContentHash
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> ContentHash
pub const fn from_bytes(bytes: [u8; 32]) -> ContentHash
Creates a content hash from raw SHA-256 digest bytes.
Trait Implementations§
Source§impl Clone for ContentHash
impl Clone for ContentHash
Source§fn clone(&self) -> ContentHash
fn clone(&self) -> ContentHash
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentHash
impl Debug for ContentHash
Source§impl<'de> Deserialize<'de> for ContentHash
impl<'de> Deserialize<'de> for ContentHash
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ContentHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ContentHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Display for ContentHash
impl Display for ContentHash
impl Eq for ContentHash
Source§impl FromStr for ContentHash
impl FromStr for ContentHash
Source§type Err = ContentHashParseError
type Err = ContentHashParseError
Source§fn from_str(text: &str) -> Result<ContentHash, <ContentHash as FromStr>::Err>
fn from_str(text: &str) -> Result<ContentHash, <ContentHash as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for ContentHash
impl Hash for ContentHash
Source§impl PartialEq for ContentHash
impl PartialEq for ContentHash
Source§impl Serialize for ContentHash
impl Serialize for ContentHash
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for ContentHash
Auto Trait Implementations§
impl Freeze for ContentHash
impl RefUnwindSafe for ContentHash
impl Send for ContentHash
impl Sync for ContentHash
impl Unpin for ContentHash
impl UnsafeUnpin for ContentHash
impl UnwindSafe for ContentHash
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.