Skip to main content

Authenticated

Trait Authenticated 

Source
pub trait Authenticated: Send + Sync {
    // Required methods
    fn set_credentials(&mut self, creds: ExchangeCredentials);
    fn is_authenticated(&self) -> bool;
    fn credential_type(&self) -> Option<CredentialKind>;
}
Expand description

Marks a connector as credential-aware and capable of authenticated requests.

Connectors that ONLY support public endpoints (e.g. read-only data feeds) do NOT implement this trait.

§Auth is internal

Connectors sign requests internally. This trait only controls credential storage and the ability to check authentication state. Callers use set_credentials once at construction time and then call the trading/account trait methods normally.

Required Methods§

Source

fn set_credentials(&mut self, creds: ExchangeCredentials)

Store credentials in the connector for use in all subsequent requests.

Calling this replaces any previously stored credentials. The connector validates the credential variant matches its expected type and returns ExchangeError::InvalidCredentials if mismatched.

Source

fn is_authenticated(&self) -> bool

Returns true if credentials have been set and the connector is ready to make authenticated requests.

Source

fn credential_type(&self) -> Option<CredentialKind>

Returns the credential scheme this connector accepts, or None if the connector only supports public (unauthenticated) requests.

Implementors§