arcgis 0.1.3

Type-safe Rust SDK for the ArcGIS REST API with compile-time guarantees
Documentation
//! Authentication provider trait.

use crate::Result;
use async_trait::async_trait;

/// Trait for authentication providers.
///
/// Implementors of this trait can provide authentication credentials
/// for ArcGIS API requests.
#[async_trait]
pub trait AuthProvider: Send + Sync {
    /// Returns the authentication token or API key to use for requests.
    async fn get_token(&self) -> Result<String>;

    /// Returns whether this provider requires a token parameter.
    fn requires_token_param(&self) -> bool {
        true
    }
}