pub struct SqlStore { /* private fields */ }Expand description
Tuples in the rws_authz_tuples table (created if missing): one row per
tuple, keyed by the SHA-256 of its text so the key fits every database’s
index limit, indexed by object and relation for checks.
Implementations§
Source§impl SqlStore
impl SqlStore
Sourcepub fn open(config: DbConfig) -> Result<SqlStore, AuthzError>
Available on crate features model-mysql or model-postgres or model-sqlite only.
pub fn open(config: DbConfig) -> Result<SqlStore, AuthzError>
model-mysql or model-postgres or model-sqlite only.Connect with config (its pool lives on the store’s own runtime) and
create the table if it’s missing.
Trait Implementations§
Source§impl TupleStore for SqlStore
impl TupleStore for SqlStore
Source§fn write(&self, tuple: &Tuple) -> Result<bool, AuthzError>
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>
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>
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>
fn list( &self, filter: &TupleFilter, limit: usize, ) -> Result<Vec<Tuple>, AuthzError>
Tuples matching
filter, at most limit.Auto Trait Implementations§
impl !Freeze for SqlStore
impl !RefUnwindSafe for SqlStore
impl !UnwindSafe for SqlStore
impl Send for SqlStore
impl Sync for SqlStore
impl Unpin for SqlStore
impl UnsafeUnpin for SqlStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more