pub struct EntityFieldVisibilityV1 { /* private fields */ }Expand description
One canonical entity-field visibility entry.
Ordinary fields never reveal a secret-classified field (ADR-0118):
enumerating every field — the de-facto wildcard and the shape every role
default produces — is inert for secrets. Revealing one requires naming it
in the separate secret_fields list, which no derivation path populates
implicitly.
Implementations§
Source§impl EntityFieldVisibilityV1
impl EntityFieldVisibilityV1
Sourcepub fn new(
lineage: ContractLineage,
entity_type: EntityTypeId,
fields: Vec<FieldId>,
) -> Result<Self, CapabilityGrantError>
pub fn new( lineage: ContractLineage, entity_type: EntityTypeId, fields: Vec<FieldId>, ) -> Result<Self, CapabilityGrantError>
Sorts and validates a nonempty field set with no secret-field naming.
Sourcepub fn with_secret_fields(
lineage: ContractLineage,
entity_type: EntityTypeId,
fields: Vec<FieldId>,
secret_fields: Vec<FieldId>,
) -> Result<Self, CapabilityGrantError>
pub fn with_secret_fields( lineage: ContractLineage, entity_type: EntityTypeId, fields: Vec<FieldId>, secret_fields: Vec<FieldId>, ) -> Result<Self, CapabilityGrantError>
Sorts and validates a visibility entry that explicitly names secret-classified fields for reveal (ADR-0118 item 3).
The named secret fields count against the same bounds as ordinary visibility. At least one of the ordinary or secret lists must be nonempty.
Sourcepub const fn lineage(&self) -> &ContractLineage
pub const fn lineage(&self) -> &ContractLineage
Returns the exact contract lineage.
Sourcepub const fn entity_type(&self) -> EntityTypeId
pub const fn entity_type(&self) -> EntityTypeId
Returns the stable entity type identity.
Sourcepub fn secret_fields(&self) -> &[FieldId]
pub fn secret_fields(&self) -> &[FieldId]
Returns explicitly named secret-classified fields in increasing order (ADR-0118): the only naming surface that reveals a secret field.