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
sourceimpl 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)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trait Implementations
sourceimpl Clone for ResourceBlocks
impl Clone for ResourceBlocks
sourcefn clone(&self) -> ResourceBlocks
fn clone(&self) -> ResourceBlocks
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for ResourceBlocks
impl Default for ResourceBlocks
sourcefn 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more