pub struct AgentAuthority {
pub authority_hash: String,
pub agent_id: Uuid,
pub role: AgentRole,
pub profile: String,
pub provider: String,
pub model: String,
pub credential_id: Option<String>,
}Expand description
Secret-free, content-addressed authority assigned to one agent session.
Fields§
Canonical digest over all remaining fields.
agent_id: UuidRuntime-owned agent identity, distinct for every delegated session.
role: AgentRoleContract role for this authority.
profile: StringExplicit provider profile selected by the coordinator.
provider: StringProvider adapter identifier.
model: StringExact model selector.
credential_id: Option<String>Public credential identity, never credential material.
Implementations§
Source§impl AgentAuthority
impl AgentAuthority
Sourcepub fn new(
role: AgentRole,
profile: impl Into<String>,
provider: impl Into<String>,
model: impl Into<String>,
credential_id: Option<String>,
) -> Result<Self, AgentError>
pub fn new( role: AgentRole, profile: impl Into<String>, provider: impl Into<String>, model: impl Into<String>, credential_id: Option<String>, ) -> Result<Self, AgentError>
Constructs and content-addresses a secret-free authority.
Sourcepub fn material_digest(&self) -> Result<String, AgentError>
pub fn material_digest(&self) -> Result<String, AgentError>
Computes the canonical digest over the authority material.
Sourcepub fn validate(&self) -> Result<(), AgentError>
pub fn validate(&self) -> Result<(), AgentError>
Validates identity fields and the content-addressed authority hash.
Trait Implementations§
Source§impl Clone for AgentAuthority
impl Clone for AgentAuthority
Source§fn clone(&self) -> AgentAuthority
fn clone(&self) -> AgentAuthority
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AgentAuthority
impl Debug for AgentAuthority
Source§impl<'de> Deserialize<'de> for AgentAuthority
impl<'de> Deserialize<'de> for AgentAuthority
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
impl Eq for AgentAuthority
Source§impl PartialEq for AgentAuthority
impl PartialEq for AgentAuthority
Source§impl Serialize for AgentAuthority
impl Serialize for AgentAuthority
impl StructuralPartialEq for AgentAuthority
Auto Trait Implementations§
impl Freeze for AgentAuthority
impl RefUnwindSafe for AgentAuthority
impl Send for AgentAuthority
impl Sync for AgentAuthority
impl Unpin for AgentAuthority
impl UnsafeUnpin for AgentAuthority
impl UnwindSafe for AgentAuthority
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