Skip to main content

Method

Trait Method 

Source
pub trait Method: Send + Sync {
    type Provider: Provider;
    type Connection;
    type Session: DeserializeOwned + Serialize;

    // Required methods
    fn id(&self) -> String;
    fn actions(
        &self,
    ) -> Vec<Box<dyn MethodAction<Self::Provider, Self::Session>>>;
    fn providers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Provider>, ShieldError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn user_connections<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user: &'life1 str,
        provider_id: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Connection>, ShieldError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn action_by_id(
        &self,
        action_id: &str,
    ) -> Option<Box<dyn MethodAction<Self::Provider, Self::Session>>> { ... }
    fn provider_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        provider_id: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Provider>, ShieldError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

Source

fn id(&self) -> String

Source

fn actions(&self) -> Vec<Box<dyn MethodAction<Self::Provider, Self::Session>>>

Source

fn providers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Provider>, ShieldError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn user_connections<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user: &'life1 str, provider_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Connection>, ShieldError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn action_by_id( &self, action_id: &str, ) -> Option<Box<dyn MethodAction<Self::Provider, Self::Session>>>

Source

fn provider_by_id<'life0, 'life1, 'async_trait>( &'life0 self, provider_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Provider>, ShieldError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§