pub struct OAuthTokenManager { /* private fields */ }Expand description
Manages OAuth 2.1 token lifecycle: acquisition, caching, and refresh.
Thread-safe — the internal state is behind a Mutex so multiple concurrent
tool calls share and reuse the same cached token.
Implementations§
Source§impl OAuthTokenManager
impl OAuthTokenManager
Sourcepub fn new(config: McpOAuthConfig) -> Self
pub fn new(config: McpOAuthConfig) -> Self
Create a new token manager for the given OAuth configuration.
Sourcepub async fn get_token(&self) -> Result<String, SynapticError>
pub async fn get_token(&self) -> Result<String, SynapticError>
Return a valid access token, refreshing or re-acquiring as needed.
Auto Trait Implementations§
impl Freeze for OAuthTokenManager
impl !RefUnwindSafe for OAuthTokenManager
impl Send for OAuthTokenManager
impl Sync for OAuthTokenManager
impl Unpin for OAuthTokenManager
impl UnsafeUnpin for OAuthTokenManager
impl !UnwindSafe for OAuthTokenManager
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