OpenAgentID documentation
Source referencesRust module referenceoas-document

oas-document · visibility

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

Source: oas/oas/oas-document/src/visibility.rs. SHA-256: d9380fe685f75a2d877377b171f261d8860a59f297a08483543107168c13c059.

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.

visibility::Visibility

Visibility level for access-controlled fields.

Controls who can read a field's actual value versus seeing only a capability advertisement (e.g., "this agent has a calendar" without revealing the booking URL).

Examples

use oas_document::visibility::Visibility;

let vis = Visibility::Organization;
assert_eq!(vis.as_str(), "organization");
assert!(!vis.is_public());
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Visibility {
    /// Visible to anyone resolving the DID. Full value stored on DHT.
    #[default]
    Public,

    /// Visible to any agent that can prove identity via DID-Auth.
    /// DHT stores only a capability flag; actual value served via
    /// authenticated endpoint.
    Authenticated,

    /// Visible only to members of the same Autonomous Organization or
    /// Entity Name Record (verified via lineage chain).
    /// DHT stores only a capability flag.
    Organization,

    /// Visible only to the entity itself. Never stored on the DHT.
    Private,
}

Source line: 40.

visibility::Visibility::as_str

Returns the string representation.

pub fn as_str(&self) -> &'static str;

Source line: 61.

visibility::Visibility::is_public

Returns true if this field should be fully visible on the public DHT.

pub fn is_public(&self) -> bool;

Source line: 71.

visibility::Visibility::is_redacted_on_dht

Returns true if this field should be redacted (capability flag only) or hidden entirely in the DHT-stored copy.

pub fn is_redacted_on_dht(&self) -> bool;

Source line: 77.

On this page