pub struct ComponentTypeId(/* private fields */);Expand description
Content-addressed identifier for a compiled component artifact.
Derived from the SHA-256 hash of the component binary. Two components
compiled from the same source with the same toolchain produce the same
ComponentTypeId. Used for compilation caching and artifact deduplication.
§Invariants
- The inner
[u8; 32]is always a valid SHA-256 digest. - Two distinct component binaries must never share a
ComponentTypeId(guaranteed by SHA-256 collision resistance).
§Examples
use torvyn_types::ComponentTypeId;
let hash = [0xab; 32];
let id = ComponentTypeId::new(hash);
assert_eq!(id.as_bytes(), &[0xab; 32]);Implementations§
Trait Implementations§
Source§impl Clone for ComponentTypeId
impl Clone for ComponentTypeId
Source§fn clone(&self) -> ComponentTypeId
fn clone(&self) -> ComponentTypeId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentTypeId
impl Debug for ComponentTypeId
Source§impl<'de> Deserialize<'de> for ComponentTypeId
impl<'de> Deserialize<'de> for ComponentTypeId
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 Display for ComponentTypeId
impl Display for ComponentTypeId
Source§impl Hash for ComponentTypeId
impl Hash for ComponentTypeId
Source§impl PartialEq for ComponentTypeId
impl PartialEq for ComponentTypeId
Source§impl Serialize for ComponentTypeId
impl Serialize for ComponentTypeId
impl Copy for ComponentTypeId
impl Eq for ComponentTypeId
impl StructuralPartialEq for ComponentTypeId
Auto Trait Implementations§
impl Freeze for ComponentTypeId
impl RefUnwindSafe for ComponentTypeId
impl Send for ComponentTypeId
impl Sync for ComponentTypeId
impl Unpin for ComponentTypeId
impl UnwindSafe for ComponentTypeId
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