pub struct ScopeDimensions {
pub domain: ScopeValue,
pub subdomain: ScopeValue,
pub class: ScopeValue,
pub instance: ScopeValue,
pub identity: ScopeValue,
pub extra: BTreeMap<String, ScopeValue>,
pub conditions: Vec<Value>,
}Expand description
A multi-dimensional scope: the five named SIGNATIF dimensions plus an extension map for scheme-registered dimensions.
Fields§
§domain: ScopeValueTop-level business or regulatory domain.
subdomain: ScopeValueSubdivision of the domain.
class: ScopeValueClass of objects the authority may attest.
instance: ScopeValueA specific instance identifier (batch, serial, lot).
identity: ScopeValueAuthorized actor identity.
extra: BTreeMap<String, ScopeValue>Scheme-registered extension dimensions.
conditions: Vec<Value>Executable scope conditions (JSON Logic subset) evaluated at verification time against the artifact and its chain (§11).
Implementations§
Source§impl ScopeDimensions
impl ScopeDimensions
Sourcepub fn unconstrained() -> Self
pub fn unconstrained() -> Self
Unconstrained scope (all wildcards).
Sourcepub fn dimensions(&self) -> impl Iterator<Item = (&'static str, &ScopeValue)>
pub fn dimensions(&self) -> impl Iterator<Item = (&'static str, &ScopeValue)>
Iterate over (dimension, value) pairs, named dimensions first.
Sourcepub fn get(&self, dimension: &str) -> Option<&ScopeValue>
pub fn get(&self, dimension: &str) -> Option<&ScopeValue>
Look up a dimension by name, including extensions.
Sourcepub fn set(&mut self, dimension: &str, value: ScopeValue)
pub fn set(&mut self, dimension: &str, value: ScopeValue)
Set a dimension value by name (including extensions).
Sourcepub fn narrows_within(&self, parent: &ScopeDimensions) -> bool
pub fn narrows_within(&self, parent: &ScopeDimensions) -> bool
The monotonic narrowing invariant: self (child) narrows within
parent on every dimension. Dimensions absent from the parent
are unconstrained by the parent and therefore always satisfied.
Sourcepub fn first_widened_dimension(
&self,
parent: &ScopeDimensions,
) -> Option<String>
pub fn first_widened_dimension( &self, parent: &ScopeDimensions, ) -> Option<String>
Returns the first dimension on which self widens relative to
parent, if any — used to produce precise hard-failure errors.
Trait Implementations§
Source§impl Clone for ScopeDimensions
impl Clone for ScopeDimensions
Source§fn clone(&self) -> ScopeDimensions
fn clone(&self) -> ScopeDimensions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScopeDimensions
impl Debug for ScopeDimensions
Source§impl Default for ScopeDimensions
impl Default for ScopeDimensions
Source§fn default() -> ScopeDimensions
fn default() -> ScopeDimensions
Source§impl<'de> Deserialize<'de> for ScopeDimensions
impl<'de> Deserialize<'de> for ScopeDimensions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ScopeDimensions
Source§impl PartialEq for ScopeDimensions
impl PartialEq for ScopeDimensions
Source§fn eq(&self, other: &ScopeDimensions) -> bool
fn eq(&self, other: &ScopeDimensions) -> bool
self and other values to be equal, and is used by ==.