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§
Sourcefn write(&self, tuple: &Tuple) -> Result<bool, AuthzError>
fn write(&self, tuple: &Tuple) -> Result<bool, AuthzError>
Store tuple; true if it wasn’t there.
Sourcefn delete(&self, tuple: &Tuple) -> Result<bool, AuthzError>
fn delete(&self, tuple: &Tuple) -> Result<bool, AuthzError>
Remove tuple; true if it was there.
Sourcefn read(
&self,
object: &ObjectRef,
relation: &str,
) -> Result<Vec<Subject>, AuthzError>
fn read( &self, object: &ObjectRef, relation: &str, ) -> Result<Vec<Subject>, AuthzError>
The subjects with relation on object.
Sourcefn list(
&self,
filter: &TupleFilter,
limit: usize,
) -> Result<Vec<Tuple>, AuthzError>
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".