pub struct BearerAuth { /* private fields */ }Expand description
Bearer-token authentication (Authorization: Bearer <token>).
Implementations§
Source§impl BearerAuth
impl BearerAuth
Sourcepub fn new(token: &str) -> Result<Self, ClientError>
pub fn new(token: &str) -> Result<Self, ClientError>
Construct a BearerAuth from a Bearer token string.
§Errors
ClientError::InvalidArgumentiftokenis empty or contains whitespace (RFC 6750 §2.1 bearer tokens must not contain whitespace).ClientError::InvalidHeaderValueiftokencontains characters that are not valid in an HTTP header value (non-visible-ASCII octets).
Trait Implementations§
Source§impl AuthProvider for BearerAuth
impl AuthProvider for BearerAuth
Source§impl Clone for BearerAuth
impl Clone for BearerAuth
Source§fn clone(&self) -> BearerAuth
fn clone(&self) -> BearerAuth
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BearerAuth
impl RefUnwindSafe for BearerAuth
impl Send for BearerAuth
impl Sync for BearerAuth
impl Unpin for BearerAuth
impl UnsafeUnpin for BearerAuth
impl UnwindSafe for BearerAuth
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