Skip to main content

AnyRoleMethod

Trait AnyRoleMethod 

Source
pub trait AnyRoleMethod:
    AnyExt
    + DatabaseConsumer
    + Serialize
    + Deserialize {
    // Required methods
    fn get<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CompactString>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        user_id: UserId,
        role: CompactString,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait implemented for every role’s storage backend.

Required Methods§

Source

fn get<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, user_id: UserId, ) -> Pin<Box<dyn Future<Output = Result<Option<CompactString>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the role of the given user.

Source

fn set<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, user_id: UserId, role: CompactString, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set the role of the given user.

Source

fn remove<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, user_id: UserId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove the role of the given user.

Trait Implementations§

Source§

impl<'typetag> Serialize for dyn AnyRoleMethod + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyRoleMethod + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyRoleMethod + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyRoleMethod + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§