pub trait AccessToken: Debug + Sync + Send + 'static {
    // Required method
    fn get_authorization_token(&self) -> &str;
}
Expand description

Trait which can be used for implementing custom access token.

Example:

    #[derive(Debug)]
    struct SuperToken(Box<str>);

    impl SuperToken {
        pub fn new() -> Self {
            Self("super-name Jindřich".into())
        }
    }

    impl AccessToken for SuperToken {
        fn get_authorization_token(&self) -> &str {
            &self.0
        }
    }

Required Methods§

source

fn get_authorization_token(&self) -> &str

Return reference to array of pairs (<HeaderName>, <HeaderValue>).

Implementors§