Skip to main content

TupleStore

Trait TupleStore 

Source
pub trait TupleStore: Send + Sync {
    // Required methods
    fn write(&self, tuple: &Tuple) -> Result<bool, AuthzError>;
    fn delete(&self, tuple: &Tuple) -> Result<bool, AuthzError>;
    fn read(
        &self,
        object: &ObjectRef,
        relation: &str,
    ) -> Result<Vec<Subject>, AuthzError>;
    fn list(
        &self,
        filter: &TupleFilter,
        limit: usize,
    ) -> Result<Vec<Tuple>, AuthzError>;
}
Expand description

Where tuples live.

Required Methods§

Source

fn write(&self, tuple: &Tuple) -> Result<bool, AuthzError>

Store tuple; true if it wasn’t there.

Source

fn delete(&self, tuple: &Tuple) -> Result<bool, AuthzError>

Remove tuple; true if it was there.

Source

fn read( &self, object: &ObjectRef, relation: &str, ) -> Result<Vec<Subject>, AuthzError>

The subjects with relation on object.

Source

fn list( &self, filter: &TupleFilter, limit: usize, ) -> Result<Vec<Tuple>, AuthzError>

Tuples matching filter, at most limit.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§