pub struct CanonicalResolutionKey { /* private fields */ }Expand description
Project-qualified canonical identity used for export and dependency resolution.
The fixed digest is the indexed hot-path value. The canonical identity remains alongside it as the collision witness and includes every identity-affecting provider, language, package, scope, relation-family, and target field.
Implementations§
Source§impl CanonicalResolutionKey
impl CanonicalResolutionKey
Sourcepub fn new(
project: ProjectInstanceId,
domain: ResolutionKeyDomain,
provider: &GraphIdentityText,
language: &GraphIdentityText,
package: Option<&GraphIdentityText>,
scope: Option<&GraphIdentityText>,
relation: Option<GraphRelationKind>,
identity: &GraphIdentityText,
) -> Self
pub fn new( project: ProjectInstanceId, domain: ResolutionKeyDomain, provider: &GraphIdentityText, language: &GraphIdentityText, package: Option<&GraphIdentityText>, scope: Option<&GraphIdentityText>, relation: Option<GraphRelationKind>, identity: &GraphIdentityText, ) -> Self
Construct a deterministic canonical resolution key.
Sourcepub fn from_persisted(
project: ProjectInstanceId,
domain: ResolutionKeyDomain,
digest: [u8; 32],
canonical_identity: String,
) -> Result<Self, GraphContractError>
pub fn from_persisted( project: ProjectInstanceId, domain: ResolutionKeyDomain, digest: [u8; 32], canonical_identity: String, ) -> Result<Self, GraphContractError>
Reconstruct and validate persisted canonical key material.
§Errors
Returns an error when the witness is not qualified by the declared project and domain or its digest does not match.
Sourcepub const fn project(&self) -> ProjectInstanceId
pub const fn project(&self) -> ProjectInstanceId
Return the owning project instance.
Sourcepub const fn domain(&self) -> ResolutionKeyDomain
pub const fn domain(&self) -> ResolutionKeyDomain
Return the closed resolver domain.
Sourcepub const fn digest_bytes(&self) -> [u8; 32]
pub const fn digest_bytes(&self) -> [u8; 32]
Return the fixed compact digest used by normalized persistence.
Sourcepub fn canonical_identity(&self) -> &str
pub fn canonical_identity(&self) -> &str
Borrow the canonical collision witness.
Sourcepub fn portable(&self) -> Result<PortableResolutionKey, GraphContractError>
pub fn portable(&self) -> Result<PortableResolutionKey, GraphContractError>
Remove project qualification while retaining the exact canonical resolver material needed to rebind a derived graph snapshot.
§Errors
Returns an error if the private canonical-key invariant was violated.
Sourcepub fn reconcile(&self, other: &Self) -> Result<bool, GraphContractError>
pub fn reconcile(&self, other: &Self) -> Result<bool, GraphContractError>
Compare compact keys without silently accepting a digest collision.
§Errors
Returns GraphContractError::StableKeyCollision when equal compact keys
retain different canonical material.
Trait Implementations§
Source§impl Clone for CanonicalResolutionKey
impl Clone for CanonicalResolutionKey
Source§fn clone(&self) -> CanonicalResolutionKey
fn clone(&self) -> CanonicalResolutionKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CanonicalResolutionKey
impl Debug for CanonicalResolutionKey
Source§impl<'de> Deserialize<'de> for CanonicalResolutionKey
impl<'de> Deserialize<'de> for CanonicalResolutionKey
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>,
Source§impl Hash for CanonicalResolutionKey
impl Hash for CanonicalResolutionKey
Source§impl Ord for CanonicalResolutionKey
impl Ord for CanonicalResolutionKey
Source§fn cmp(&self, other: &CanonicalResolutionKey) -> Ordering
fn cmp(&self, other: &CanonicalResolutionKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CanonicalResolutionKey
impl PartialEq for CanonicalResolutionKey
Source§impl PartialOrd for CanonicalResolutionKey
impl PartialOrd for CanonicalResolutionKey
Source§impl Serialize for CanonicalResolutionKey
impl Serialize for CanonicalResolutionKey
impl Eq for CanonicalResolutionKey
impl StructuralPartialEq for CanonicalResolutionKey
Auto Trait Implementations§
impl Freeze for CanonicalResolutionKey
impl RefUnwindSafe for CanonicalResolutionKey
impl Send for CanonicalResolutionKey
impl Sync for CanonicalResolutionKey
impl Unpin for CanonicalResolutionKey
impl UnwindSafe for CanonicalResolutionKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.