pub struct NoToken;
Expand description
In the event that the API endpoint does not require an OAuth2 token, NoToken
should be
provided to the hub to avoid specifying an authenticator.
Trait Implementations§
source§impl GetToken for NoToken
impl GetToken for NoToken
source§fn get_token<'a>(
&'a self,
_scopes: &'a [&str],
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>
fn get_token<'a>( &'a self, _scopes: &'a [&str], ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>
Called whenever an API call requires authentication via an oauth2 token.
Returns
Ok(None)
if a token is not necessary - otherwise, returns an error
indicating the reason why a token could not be produced.Auto Trait Implementations§
impl Freeze for NoToken
impl RefUnwindSafe for NoToken
impl Send for NoToken
impl Sync for NoToken
impl Unpin for NoToken
impl UnwindSafe for NoToken
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> GetTokenClone for T
impl<T> GetTokenClone for T
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more