pub struct OAuth {
pub config: Config,
/* private fields */
}Expand description
Client Credentials Grant (CCG) authentication
Fields§
§config: ConfigImplementations§
Source§impl OAuth
impl OAuth
pub fn new( config: Config, client_id: String, client_secret: String, store: Option<fn(String)>, ) -> Self
pub fn is_expired(&self) -> bool
pub async fn request_access_token( &mut self, code: String, ) -> Result<AccessToken, AuthError>
pub fn set_access_token( &mut self, access_token: AccessToken, ) -> Result<(), AuthError>
Trait Implementations§
Source§impl<'a> Auth<'a> for OAuth
impl<'a> Auth<'a> for OAuth
fn access_token<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn to_json<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn base_api_url(&self) -> String
fn user_agent(&self) -> String
Source§impl<'de> Deserialize<'de> for OAuth
impl<'de> Deserialize<'de> for OAuth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OAuth
impl !RefUnwindSafe for OAuth
impl Send for OAuth
impl Sync for OAuth
impl Unpin for OAuth
impl !UnwindSafe for OAuth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more