oas-document · service
Declared module signatures, types, configuration, and source documentation.
Source: oas/oas/oas-document/src/service.rs. SHA-256: f130b2274ff01d645d8f04f7f31b2b0f4a775c72e9a7c195077c8286c7c616da.
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.
service::ServiceEndpoint
A service endpoint in an OAS Identity Document.
See OAS Specification §5.6 for standard service types.
Examples
use oas_document::service::ServiceEndpoint;
let svc = ServiceEndpoint {
id: "did:oas:ns:agent:bot#api".to_string(),
service_type: "OASEntity".to_string(),
service_endpoint: "https://example.com/bot".to_string(),
label: Some("Primary API".to_string()),
description: Some("Main agent interaction endpoint".to_string()),
properties: None,
};#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ServiceEndpoint {
/// The service ID (e.g., `did:oas:ns:agent:bot#service-1`).
pub id: String,
/// The service type.
#[serde(rename = "type")]
pub service_type: String,
/// The service endpoint URI.
pub service_endpoint: String,
/// Human-readable label for this service.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
/// Human-readable description of what this service does.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Arbitrary key-value properties for this service.
/// Useful for protocol-specific metadata (e.g., API version, auth scheme).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<BTreeMap<String, String>>
}Source line: 28.
service::service_types
Standard service types defined by OAS Specification §5.6.
pub mod service_types;Source line: 54.
service::service_types::OAS_ENTITY
Primary entity interaction endpoint.
pub const OAS_ENTITY: &str;Source line: 56.
service::service_types::OAS_COMMUNICATION
Communication / messaging endpoint.
pub const OAS_COMMUNICATION: &str;Source line: 58.
service::service_types::OAS_LINEAGE_QUERY
Lineage chain query service.
pub const OAS_LINEAGE_QUERY: &str;Source line: 60.
service::service_types::OAS_ATTESTATION
Third-party attestation service.
pub const OAS_ATTESTATION: &str;Source line: 62.
service::service_types::OAS_REVOCATION_STATUS
Revocation status check endpoint.
pub const OAS_REVOCATION_STATUS: &str;Source line: 64.
service::service_types::OAS_CAPABILITY_INVOCATION
Capability invocation endpoint.
pub const OAS_CAPABILITY_INVOCATION: &str;Source line: 66.
service::service_types::OAS_GOVERNANCE
Governance operations endpoint.
pub const OAS_GOVERNANCE: &str;Source line: 68.
service::service_types::OAS_PRIVATE_ENDPOINT
Authenticated endpoint for resolving visibility-restricted fields. Agents query this service with DID-Auth to retrieve fields that are redacted in the public DHT document.
pub const OAS_PRIVATE_ENDPOINT: &str;Source line: 72.