OpenAgentID documentation
Source referencesRust module referenceoas-did

oas-did · error

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

Source: oas/oas/oas-did/src/error.rs. SHA-256: 7a732512f4c2b4698eba8e790e92162d2580d494df3e5af8b8afdd06cfadab74.

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.

error::DidError

Errors arising from parsing or validating did:oas identifiers.

#[derive(Debug, Error, Clone, PartialEq, Eq)]
pub enum DidError {
    /// The DID string does not start with `did:oas:`.
    #[error("invalid DID prefix: expected 'did:oas:', got '{found}'")]
    InvalidPrefix {
        /// The prefix that was found.
        found: String,
    },

    /// The DID does not have enough components.
    #[error("DID has {found} components, expected at least 5 (did:oas:namespace:kind:identifier)")]
    TooFewComponents {
        /// How many components were found.
        found: usize,
    },

    /// The namespace is invalid per OAS Spec §3.1.
    #[error("invalid namespace '{namespace}': {reason}")]
    InvalidNamespace {
        /// The invalid namespace value.
        namespace: String,
        /// Why it's invalid.
        reason: String,
    },

    /// The entity kind is not recognized.
    #[error("unknown entity kind '{found}'; expected one of: hmr, mhr, enr, ao, agent, agent:instance, tool, skill, workflow, model, dataset, service")]
    UnknownEntityKind {
        /// The unrecognized kind string.
        found: String,
    },

    /// The identifier is invalid per OAS Spec §3.1.
    #[error("invalid identifier '{identifier}': {reason}")]
    InvalidIdentifier {
        /// The invalid identifier value.
        identifier: String,
        /// Why it's invalid.
        reason: String,
    },

    /// The DID string is empty.
    #[error("DID string is empty")]
    Empty,
}

Source line: 8.

On this page