Skip to main content

Connector

Trait Connector 

Source
pub trait Connector:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn id(&self) -> ConnectorId;
    fn descriptor(&self) -> ConnectorDescriptor;
    fn verify<'life0, 'life1, 'async_trait>(
        &'life0 self,
        account: &'life1 AccountId,
    ) -> Pin<Box<dyn Future<Output = Result<AccountIdentity>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An integration with one external service.

Required Methods§

Source

fn id(&self) -> ConnectorId

Source

fn descriptor(&self) -> ConnectorDescriptor

What this connector is and what it needs. Used by the settings UI and by the permission review — a connector cannot quietly widen its scopes.

Source

fn verify<'life0, 'life1, 'async_trait>( &'life0 self, account: &'life1 AccountId, ) -> Pin<Box<dyn Future<Output = Result<AccountIdentity>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prove that an account’s credentials still work, and report who they belong to.

This is the one operation every connector must support. It is what turns “we have a token” into “we have a working account”, and it runs after authorization and whenever credentials are suspected to be stale.

Returns AppError::Authentication when the credentials are no longer valid — the platform reacts by marking the account expired, not by retrying.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§