Struct polar_core::resource_block::ResourceBlocks
source · pub struct ResourceBlocks {
pub shorthand_rules: HashMap<Term, Vec<ShorthandRule>>,
pub actors: HashSet<Term>,
pub resources: HashSet<Term>,
/* private fields */
}
Fields§
§shorthand_rules: HashMap<Term, Vec<ShorthandRule>>
Map from resource (Symbol
) to the shorthand rules declared in that resource’s block.
actors: HashSet<Term>
Set of all resource block types declared as actors. Internally treated like a union type where all declared types are members of the union.
resources: HashSet<Term>
Set of all resource block types declared as resources. Internally treated like a union type where all declared types are members of the union.
Implementations§
source§impl ResourceBlocks
impl ResourceBlocks
pub fn new() -> Self
pub fn clear(&mut self)
sourcepub fn get_relation_type_in_resource_block(
&self,
relation: &Term,
resource: &Term
) -> PolarResult<&Term>
pub fn get_relation_type_in_resource_block( &self, relation: &Term, resource: &Term ) -> PolarResult<&Term>
Look up relation
in resource
block and return its type.
pub fn declarations(&self) -> &HashMap<Term, HashMap<Term, Declaration>>
pub fn has_roles(&self) -> bool
pub fn relation_tuples(&self) -> Vec<(&Term, &Term, &Term)>
Trait Implementations§
source§impl Clone for ResourceBlocks
impl Clone for ResourceBlocks
source§fn clone(&self) -> ResourceBlocks
fn clone(&self) -> ResourceBlocks
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for ResourceBlocks
impl Default for ResourceBlocks
source§fn default() -> ResourceBlocks
fn default() -> ResourceBlocks
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ResourceBlocks
impl Send for ResourceBlocks
impl Sync for ResourceBlocks
impl Unpin for ResourceBlocks
impl UnwindSafe for ResourceBlocks
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more