RuleSpace

Trait RuleSpace 

Source
pub trait RuleSpace<Q, S>
where Q: RawState,
{ // Required methods fn get(&self, head: &Head<Q, S>) -> Option<&Tail<Q, S>> where Q: PartialEq, S: PartialEq; fn get_mut(&mut self, head: &Head<Q, S>) -> Option<&mut Tail<Q, S>> where Q: PartialEq, S: PartialEq; fn insert(&mut self, head: Head<Q, S>, tail: Tail<Q, S>); }
Expand description

The RuleSpace extends the RawSpace trait to introduce rule-specific functionality. It provides a method to retrieve the tail of a rule given its head.

Required Methods§

Source

fn get(&self, head: &Head<Q, S>) -> Option<&Tail<Q, S>>
where Q: PartialEq, S: PartialEq,

returns the tail associated with the provided head, if it exists

Source

fn get_mut(&mut self, head: &Head<Q, S>) -> Option<&mut Tail<Q, S>>
where Q: PartialEq, S: PartialEq,

returns a mutable reference to the tail associated with the provided head, if it exists

Source

fn insert(&mut self, head: Head<Q, S>, tail: Tail<Q, S>)

inserts a new rule into the storage structure

Implementations on Foreign Types§

Source§

impl<Q, A> RuleSpace<Q, A> for Vec<Rule<Q, A>>
where Q: RawState + PartialEq, A: PartialEq,

Source§

fn get(&self, key: &Head<Q, A>) -> Option<&Tail<Q, A>>

Source§

fn get_mut(&mut self, key: &Head<Q, A>) -> Option<&mut Tail<Q, A>>

Source§

fn insert(&mut self, head: Head<Q, A>, tail: Tail<Q, A>)

Source§

impl<Q, A> RuleSpace<Q, A> for HashMap<Head<Q, A>, Tail<Q, A>>
where Q: RawState + Eq + Hash, A: Eq + Hash,

Source§

fn get(&self, key: &Head<Q, A>) -> Option<&Tail<Q, A>>

Source§

fn get_mut(&mut self, key: &Head<Q, A>) -> Option<&mut Tail<Q, A>>

Source§

fn insert(&mut self, head: Head<Q, A>, tail: Tail<Q, A>)

Implementors§