OpenAgentID documentation
Source referencesRust module referenceoas-did

oas-did · namespace

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

Source: oas/oas/oas-did/src/namespace.rs. SHA-256: e9dcb9c4b49416f6d558cc3d0d02dc5184b15dff3d170aef65655dae747cfb13.

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.

namespace::RESERVED_NAMESPACES

Reserved namespaces per OAS Spec §3.2.

pub const RESERVED_NAMESPACES: &[&str];

Source line: 7.

namespace::validate_namespace

Validates an OAS namespace string.

Per OAS Specification §3.1, a namespace:

  • MUST be 1-63 characters long
  • MUST contain only lowercase alphanumeric characters and hyphens
  • MUST NOT begin or end with a hyphen

Arguments

  • namespace - The namespace string to validate.

Returns

Ok(()) if the namespace is valid.

Errors

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

Examples

use oas_did::namespace::validate_namespace;

assert!(validate_namespace("acme").is_ok());
assert!(validate_namespace("my-org-123").is_ok());
assert!(validate_namespace("-starts-with-hyphen").is_err());
pub fn validate_namespace(namespace: &str) -> Result<(), DidError>;

Source line: 37.

namespace::is_reserved

Returns true if the namespace is reserved per OAS Spec §3.2.

Examples

use oas_did::namespace::is_reserved;

assert!(is_reserved("oas"));
assert!(is_reserved("test"));
assert!(!is_reserved("acme"));
pub fn is_reserved(namespace: &str) -> bool;

Source line: 95.

On this page