OpenAgentID documentation
Source referencesRust module referenceaegis-delegate

aegis-delegate · tree

Declared module signatures, types, configuration, and source documentation.

Source: aegis/aegis-delegate/src/tree.rs. SHA-256: 1c3cc47d0b40fb63bfbc6ecc4dc089718fe7432bdf751511ad976de283c916a4.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

tree::DelegationTree

A delegation tree rooted at a human root.

Stores delegations indexed by delegate DID and by delegation ID. Max depth is configurable (default 8).

pub struct DelegationTree {

}

Source line: 17.

tree::DelegationTree::new

Creates a new empty delegation tree with the given maximum depth.

pub fn new(max_depth: u32) -> Self;

Source line: 28.

tree::DelegationTree::add_delegation

Adds a delegation to the tree.

Validates:

  • The delegation depth does not exceed max_depth
  • The delegation scope is a subset of the delegator's effective scope (no-amplification rule, §9.6)
pub fn add_delegation(&mut self, delegation: Delegation) -> Result<(), DelegationError>;

Source line: 42.

tree::DelegationTree::get_delegation_chain

Gets the delegation chain from a delegate up to the root.

Returns delegations in order from the immediate delegation (closest to the delegate) up to the root delegation.

pub fn get_delegation_chain(&self, delegate_did: &str) -> Vec<&Delegation>;

Source line: 85.

tree::DelegationTree::effective_scope

Computes the effective scope for a delegate.

This is the intersection of all scopes in the delegation chain, implementing the intersection narrowing rule (§9.6 rule 2).

pub fn effective_scope(&self, delegate_did: &str) -> Option<DelegationScope>;

Source line: 115.

tree::DelegationTree::depth

Returns the depth of a delegate in the tree.

A root entity (not a delegate of anyone) has depth 0. A direct delegate of a root has depth 1, and so on.

pub fn depth(&self, delegate_did: &str) -> u32;

Source line: 133.

tree::DelegationTree::revoke

Revokes a delegation and all sub-delegations (cascade revocation).

Returns the list of all revoked delegation IDs, including the original and all transitively dependent delegations.

pub fn revoke(&mut self, delegation_id: &str) -> Result<Vec<String>, DelegationError>;

Source line: 141.

On this page