pub struct CategoryMap { /* private fields */ }Expand description
The deployment’s category map.
Implementations§
Source§impl CategoryMap
impl CategoryMap
Sourcepub fn classify(&self, evidence: &Evidence) -> Classification
pub fn classify(&self, evidence: &Evidence) -> Classification
The categories of an access that showed evidence.
The categories of every root object and every queried id are joined,
and none never removes one. The access is of no category only when
its resource kind holds none, or when the map declares none by an
exact key for everything it reached and nothing is uncertain; it is
unclassified otherwise.
Source§impl CategoryMap
impl CategoryMap
Sourcepub fn declare(
national: &[String],
templates: &BTreeMap<String, Declared>,
archetypes: &BTreeMap<String, Declared>,
) -> Result<Self, MapError>
pub fn declare( national: &[String], templates: &BTreeMap<String, Declared>, archetypes: &BTreeMap<String, Declared>, ) -> Result<Self, MapError>
The map templates and archetypes declare, their categories read
against the six priority categories and the national ones, each
declared <system>|<code>.
§Errors
A MapError for a refused national code, an empty or malformed
key, a word other than none, an empty list, and a code that names
no category.
Sourcepub fn with_digest(self, digest: String) -> Self
pub fn with_digest(self, digest: String) -> Self
This map, named by digest, such as a hash of
CategoryMap::canonical.
Sourcepub fn template(&self, template_id: &str) -> Option<&Mapping>
pub fn template(&self, template_id: &str) -> Option<&Mapping>
What template_id maps to, when the map holds it.
Sourcepub fn archetype(&self, archetype_id: &str) -> Option<&Mapping>
pub fn archetype(&self, archetype_id: &str) -> Option<&Mapping>
What archetype_id maps to, when the map holds it.
Sourcepub fn category(&self, reference: &str) -> Option<Category>
pub fn category(&self, reference: &str) -> Option<Category>
The category reference names: a priority category by its bare code
or as <system>|<code>, or a national one the map declares, as
<system>|<code>. Codes are compared exactly.
Sourcepub fn categories(&self) -> impl Iterator<Item = Category> + '_
pub fn categories(&self) -> impl Iterator<Item = Category> + '_
Every category the map can name: the six priority categories of Art 14(1) in their order, then each national category it declares.