MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / active_for_delegate

Function active_for_delegate

atomic-canonical/src/delegation.rs:590–598  ·  view source on GitHub ↗

The certificate currently in force for `delegate`, if any.

(
    store: &atomic_identity::IdentityStore,
    delegate: &Identity,
)

Source from the content-addressed store, hash-verified

588
589/// The certificate currently in force for `delegate`, if any.
590pub fn active_for_delegate(
591 store: &atomic_identity::IdentityStore,
592 delegate: &Identity,
593) -> Option<StoredDelegation> {
594 load_for_delegate(store, delegate)
595 .ok()?
596 .into_iter()
597 .find(|d| d.is_usable())
598}
599
600// ---------------------------------------------------------------------------
601// Helpers

Callers 2

runMethod · 0.85
active_delegation_urnFunction · 0.85

Calls 3

load_for_delegateFunction · 0.70
into_iterMethod · 0.45
is_usableMethod · 0.45

Tested by

no test coverage detected