pub struct MembershipStore;Implementations§
Source§impl MembershipStore
impl MembershipStore
pub async fn find( db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Option<Membership>>
pub async fn require( db: &DbHandle, scope: ScopeRef, user_id: i64, ) -> Result<Membership>
pub async fn list_for_scope( db: &DbHandle, scope: ScopeRef, ) -> Result<Vec<Membership>>
pub async fn list_for_user( db: &DbHandle, scope_kind: &str, user_id: i64, ) -> Result<Vec<Membership>>
pub async fn add( db: &DbHandle, scope: ScopeRef, user_id: i64, role: &str, ) -> Result<Membership>
pub async fn add_with( db: &DbHandle, scope: ScopeRef, user_id: i64, role: &str, opts: MutateOpts<'_>, ) -> Result<Membership>
pub async fn update_role( db: &DbHandle, membership_id: i64, role: &str, ) -> Result<Membership>
pub async fn update_role_with( db: &DbHandle, membership_id: i64, role: &str, opts: MutateOpts<'_>, ) -> Result<Membership>
pub async fn remove(db: &DbHandle, membership_id: i64) -> Result<()>
pub async fn remove_with( db: &DbHandle, membership_id: i64, opts: MutateOpts<'_>, ) -> Result<()>
pub async fn count_role( db: &DbHandle, scope: ScopeRef, role: &str, ) -> Result<usize>
Auto Trait Implementations§
impl Freeze for MembershipStore
impl RefUnwindSafe for MembershipStore
impl Send for MembershipStore
impl Sync for MembershipStore
impl Unpin for MembershipStore
impl UnsafeUnpin for MembershipStore
impl UnwindSafe for MembershipStore
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 more