pub struct OAuthClientBuilder { /* private fields */ }
Expand description
Builder struct through which structures of type OAuthClient are instantiated.
Implementations§
Source§impl OAuthClientBuilder
impl OAuthClientBuilder
Sourcepub fn new(client_id: &str, redirect_uri: &str, scopes: Vec<&str>) -> Self
pub fn new(client_id: &str, redirect_uri: &str, scopes: Vec<&str>) -> Self
Create a new OAuthClientBuilder with provided params and default config.
redirect_uri
must match to the registered Uris of client_id
Sourcepub fn open_in_browser(self) -> Self
pub fn open_in_browser(self) -> Self
When this function is added to the building process pipeline, the auth url will be opened with the default web browser. Otherwise, it will be printed to standard output.
Sourcepub fn with_custom_message(self, message: &str) -> Self
pub fn with_custom_message(self, message: &str) -> Self
When this function is added to the building process pipeline, the body of the response to
the callback request will be message
. This is useful to load custom HTMLs to that &str.
Sourcepub fn build(self) -> Result<OAuthClient, OAuthError>
pub fn build(self) -> Result<OAuthClient, OAuthError>
End of the building process pipeline. If Ok, a OAuthClient instance will be returned.
Auto Trait Implementations§
impl Freeze for OAuthClientBuilder
impl RefUnwindSafe for OAuthClientBuilder
impl Send for OAuthClientBuilder
impl Sync for OAuthClientBuilder
impl Unpin for OAuthClientBuilder
impl UnwindSafe for OAuthClientBuilder
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