OpenAgentID documentation
Source referencesRust module referenceoas-did

oas-did · kind

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

Source: oas/oas/oas-did/src/kind.rs. SHA-256: e37dbf4c5e148ea633b4108909de20c3c0c59aa886bcb14fc4da2117758a717e.

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.

kind::EntityKind

The 12 entity kinds defined in OAS Specification §4.

Each kind represents a category of autonomous entity with distinct identity requirements and lineage constraints.

Examples

use oas_did::kind::EntityKind;
use std::str::FromStr;

let kind = EntityKind::from_str("agent").unwrap();
assert_eq!(kind, EntityKind::Agent);
assert_eq!(kind.as_str(), "agent");
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EntityKind {
    /// Human Root — a single verified human being (OAS Spec §6).
    #[serde(rename = "hmr")]
    Hmr,

    /// Multi-Human Root — a threshold group of verified humans (OAS Spec §7).
    #[serde(rename = "mhr")]
    Mhr,

    /// Entity Name Record — a stable organizational identity governed by an MHR.
    #[serde(rename = "enr")]
    Enr,

    /// Autonomous Organization — a group of agents operating as a unit.
    #[serde(rename = "ao")]
    Ao,

    /// Agent — an autonomous software entity.
    #[serde(rename = "agent")]
    Agent,

    /// Agent Instance — a specific running instance of an agent, identified by UUID.
    #[serde(rename = "agent:instance")]
    AgentInstance,

    /// Tool — a capability that agents can invoke.
    #[serde(rename = "tool")]
    Tool,

    /// Skill — a composable unit of agent behavior.
    #[serde(rename = "skill")]
    Skill,

    /// Workflow — a defined process involving one or more agents.
    #[serde(rename = "workflow")]
    Workflow,

    /// Model — a machine learning model with verified provenance.
    #[serde(rename = "model")]
    Model,

    /// Dataset — a data collection with verified provenance and lineage.
    #[serde(rename = "dataset")]
    Dataset,

    /// Service — an infrastructure service with verified identity.
    #[serde(rename = "service")]
    Service,
}

Source line: 30.

kind::EntityKind::as_str

Returns the string representation of this kind as it appears in a DID.

Examples

use oas_did::kind::EntityKind;
assert_eq!(EntityKind::AgentInstance.as_str(), "agent:instance");
assert_eq!(EntityKind::Hmr.as_str(), "hmr");
pub fn as_str(&self) -> &'static str;

Source line: 90.

kind::EntityKind::is_root

Returns true if this kind is a root entity (HMR, MHR, or ENR).

Root entities have no parent and no lineage section.

Examples

use oas_did::kind::EntityKind;
assert!(EntityKind::Hmr.is_root());
assert!(EntityKind::Mhr.is_root());
assert!(!EntityKind::Agent.is_root());
pub fn is_root(&self) -> bool;

Source line: 119.

kind::EntityKind::component_count

Returns the number of DID components this kind consumes.

Most kinds are a single component (e.g., agent), but agent:instance is a compound kind that consumes two components (agent + instance).

pub fn component_count(&self) -> usize;

Source line: 127.

On this page