pub struct ResourceObjects { /* private fields */ }Expand description
The resource objects one run’s rules reach: the answers to every class their applicability selectors name, per source.
The runtime installs it before any rule runs, replacing any host copy;
capabilities read it through ResourceObjects::reached. Capability
tests build one with ResourceObjects::with_class.
Implementations§
Source§impl ResourceObjects
impl ResourceObjects
Sourcepub fn with_class(
self,
source: SourceId,
class: impl Into<String>,
include_subtypes: bool,
answer: Result<Vec<Object>, String>,
) -> Self
pub fn with_class( self, source: SourceId, class: impl Into<String>, include_subtypes: bool, answer: Result<Vec<Object>, String>, ) -> Self
Records the answer for class (as a selector writes it) in source:
its resource objects, or why they could not be listed.
Sourcepub fn object(&self, id: &ObjectId) -> Option<&Object>
pub fn object(&self, id: &ObjectId) -> Option<&Object>
The resource object id, if a class listed it.
Sourcepub fn reached<'s>(
&'s self,
selector: &Selector,
outcomes: Option<&RuleOutcomes>,
) -> Reached<'s>
pub fn reached<'s>( &'s self, selector: &Selector, outcomes: Option<&RuleOutcomes>, ) -> Reached<'s>
The resource objects selector reaches, and the sources where it
reaches a class that could not be listed.
An entityType selector reaches its class’s resource objects; allOf
and anyOf reach what any operand reaches; a ruleOutcome selector
reaches the resource objects the named rule’s outcomes name. Nothing
else reaches a resource object: not all, not a negation, not a
related or property selector alone. A reached object is selected only
when the whole selector then matches it.