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

Function active_for_delegate

atomic-canonical/src/delegation.rs:555–563  ·  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

553
554/// The certificate currently in force for `delegate`, if any.
555pub fn active_for_delegate(
556 store: &atomic_identity::IdentityStore,
557 delegate: &Identity,
558) -> Option<StoredDelegation> {
559 load_for_delegate(store, delegate)
560 .ok()?
561 .into_iter()
562 .find(|d| d.is_usable())
563}
564
565// ---------------------------------------------------------------------------
566// Helpers

Callers 1

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