#[non_exhaustive]pub enum Auth {
Basic {
username: String,
password: String,
},
Bearer {
bearer_token: String,
},
}Expand description
The credential a URL is read with.
It is #[non_exhaustive]: a match on it needs a _ arm, so a scheme added
later does not break an action that was already written.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Trait Implementations§
Source§impl Debug for Auth
impl Debug for Auth
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
The scheme, and never the secret.
A credential is written by hand and read by a host, and the one place it has no business appearing is a log line. So this renders the scheme, and the username that names the account, and stops there.
use simpleplatform_sdk::storage::Auth;
assert_eq!(format!("{:?}", Auth::bearer("t-1234")), "Bearer { .. }");Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl UnwindSafe for Auth
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