[][src]Trait rustupolis::store::Store

pub trait Store {
    fn inp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>;
fn rdp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>;
fn out(&mut self, tup: Tuple) -> Result<()>; }

A Store is an associative memory which stores and retrieves tuples. Implementors should only store defined tuples.

Required methods

fn inp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>

Read a matching tuple and remove it atomically.

fn rdp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>

Read a matching tuple.

fn out(&mut self, tup: Tuple) -> Result<()>

Write a tuple.

Loading content...

Implementors

impl Store for SimpleStore[src]

Implements the store trait for SimpleStore.

fn out(&mut self, tup: Tuple) -> Result<()>[src]

Insert the tuple into the space if it is defined.

fn rdp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>[src]

Returns a copy of the tuple if it is defined and in the space. Otherwise look for any tuple that matches tup and return a copy. If no matches can be found, return an empty tuple.

fn inp(&mut self, tup: &Tuple) -> Result<Option<Tuple>>[src]

Returns a tuple and take it out of the space if it is defined and in the space. Otherwise look for any tuple that matches tup, take it out of the space and return it. /// If no matches can be found, return an empty tuple.

Loading content...