pub struct Provider<'a> { /* private fields */ }Expand description
pi’s McpOAuthProvider: the OAuth state of one exact server URL in a
ServerStore.
Implementations§
Source§impl<'a> Provider<'a>
impl<'a> Provider<'a>
Sourcepub fn new(
server_url: &str,
redirect_url: &str,
client_name: &str,
client_id: Option<&str>,
client_secret: Option<&str>,
store: &'a ServerStore,
) -> Result<Provider<'a>, OAuthError>
pub fn new( server_url: &str, redirect_url: &str, client_name: &str, client_id: Option<&str>, client_secret: Option<&str>, store: &'a ServerStore, ) -> Result<Provider<'a>, OAuthError>
A provider for server_url that redirects to redirect_url.
client_id and client_secret name a pre-registered client.
Sourcepub async fn state(&self) -> Result<String, OAuthError>
pub async fn state(&self) -> Result<String, OAuthError>
The state parameter, created once per sign-in.
Auto Trait Implementations§
impl<'a> Freeze for Provider<'a>
impl<'a> RefUnwindSafe for Provider<'a>
impl<'a> Send for Provider<'a>
impl<'a> Sync for Provider<'a>
impl<'a> Unpin for Provider<'a>
impl<'a> UnsafeUnpin for Provider<'a>
impl<'a> UnwindSafe for Provider<'a>
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