OpenAgentID documentation
Source referencesRust module referenceoas-did

oas-did · validation

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

Source: oas/oas/oas-did/src/validation.rs. SHA-256: a761dd2f3bf3afc274be57deddf282d8f0eab7e549324f0b76c709c775e1c900.

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.

validation::MAX_IDENTIFIER_LENGTH

Maximum length for an identifier per OAS Spec §3.1.

pub const MAX_IDENTIFIER_LENGTH: usize;

Source line: 7.

validation::validate_identifier

Validates an OAS identifier string.

Per OAS Specification §3.1, an identifier:

  • MUST be 1-128 characters long
  • MUST contain only characters from the set [a-zA-Z0-9._-]

Arguments

  • identifier - The identifier string to validate.

Returns

Ok(()) if the identifier is valid.

Errors

Returns [DidError::InvalidIdentifier] with a specific reason if validation fails.

Examples

use oas_did::validation::validate_identifier;

assert!(validate_identifier("support-bot-42").is_ok());
assert!(validate_identifier("my.model_v2").is_ok());
assert!(validate_identifier("").is_err());
pub fn validate_identifier(identifier: &str) -> Result<(), DidError>;

Source line: 36.

On this page