pub struct AuthManager { /* private fields */ }Expand description
Auth manager for handling authentication
Implementations§
Source§impl AuthManager
impl AuthManager
Sourcepub fn new(
credentials: Credentials,
server_addresses: Vec<ServerAddress>,
) -> Self
pub fn new( credentials: Credentials, server_addresses: Vec<ServerAddress>, ) -> Self
Create a new auth manager
Sourcepub fn is_auth_enabled(&self) -> bool
pub fn is_auth_enabled(&self) -> bool
Check if authentication is required
Sourcepub async fn get_token(&self) -> Result<Option<String>>
pub async fn get_token(&self) -> Result<Option<String>>
Get current valid token, refreshing if necessary
Sourcepub async fn refresh_token(&self) -> Result<()>
pub async fn refresh_token(&self) -> Result<()>
Refresh the access token
Auto Trait Implementations§
impl Freeze for AuthManager
impl !RefUnwindSafe for AuthManager
impl Send for AuthManager
impl Sync for AuthManager
impl Unpin for AuthManager
impl !UnwindSafe for AuthManager
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request