pub struct GraphEntityKey { /* private fields */ }Expand description
Stable project-qualified key for one graph entity.
Implementations§
Source§impl GraphEntityKey
impl GraphEntityKey
Sourcepub fn new(project: ProjectInstanceId, selector: &EntitySelector) -> Self
pub fn new(project: ProjectInstanceId, selector: &EntitySelector) -> Self
Derive a stable key from a project and typed selector.
Sourcepub const fn project(&self) -> ProjectInstanceId
pub const fn project(&self) -> ProjectInstanceId
Return the owning project instance.
Sourcepub fn digest_bytes(&self) -> Result<[u8; 32], GraphContractError>
pub fn digest_bytes(&self) -> Result<[u8; 32], GraphContractError>
Return the compact binary digest used by normalized persistence.
§Errors
Returns GraphContractError::InvalidStableKeyDigest if the private key
invariant was violated by incompatible persisted input.
Sourcepub fn canonical_identity(&self) -> &str
pub fn canonical_identity(&self) -> &str
Borrow the canonical identity retained for collision detection.
Sourcepub fn reconcile(&self, other: &Self) -> Result<bool, GraphContractError>
pub fn reconcile(&self, other: &Self) -> Result<bool, GraphContractError>
Determine whether two keys identify the same entity, failing on collision.
§Errors
Returns GraphContractError::StableKeyCollision when equal digests retain
different canonical identities.
Trait Implementations§
Source§impl Clone for GraphEntityKey
impl Clone for GraphEntityKey
Source§fn clone(&self) -> GraphEntityKey
fn clone(&self) -> GraphEntityKey
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 GraphEntityKey
impl Debug for GraphEntityKey
Source§impl<'de> Deserialize<'de> for GraphEntityKey
impl<'de> Deserialize<'de> for GraphEntityKey
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 PartialEq for GraphEntityKey
impl PartialEq for GraphEntityKey
Source§impl Serialize for GraphEntityKey
impl Serialize for GraphEntityKey
impl Eq for GraphEntityKey
impl StructuralPartialEq for GraphEntityKey
Auto Trait Implementations§
impl Freeze for GraphEntityKey
impl RefUnwindSafe for GraphEntityKey
impl Send for GraphEntityKey
impl Sync for GraphEntityKey
impl Unpin for GraphEntityKey
impl UnwindSafe for GraphEntityKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Compare self to
key and return true if they are equal.