pub enum AuthPayload<'a> {
None,
Token68(&'a [u8]),
Params(AuthParams<'a>),
}Expand description
What follows the scheme of a credential or a challenge.
§Examples
use parse_net::{auth, AuthPayload, Limits};
let l = Limits::DEFAULT;
assert_eq!(auth::parse_credentials(b"Negotiate", &l)?.payload(), AuthPayload::None);
assert_eq!(auth::parse_credentials(b"Bearer abc123", &l)?.payload(), AuthPayload::Token68(b"abc123"));
assert!(matches!(auth::parse_credentials(b"Digest a=b", &l)?.payload(), AuthPayload::Params(_)));Variants§
None
Nothing.
Token68(&'a [u8])
A token68, such as a bearer token or Basic base64 text.
Params(AuthParams<'a>)
auth-params.
Trait Implementations§
Source§impl<'a> Clone for AuthPayload<'a>
impl<'a> Clone for AuthPayload<'a>
impl<'a> Copy for AuthPayload<'a>
Source§impl Debug for AuthPayload<'_>
impl Debug for AuthPayload<'_>
impl<'a> Eq for AuthPayload<'a>
Source§impl<'a> Hash for AuthPayload<'a>
impl<'a> Hash for AuthPayload<'a>
Source§impl<'a> PartialEq for AuthPayload<'a>
impl<'a> PartialEq for AuthPayload<'a>
impl<'a> StructuralPartialEq for AuthPayload<'a>
Auto Trait Implementations§
impl<'a> Freeze for AuthPayload<'a>
impl<'a> RefUnwindSafe for AuthPayload<'a>
impl<'a> Send for AuthPayload<'a>
impl<'a> Sync for AuthPayload<'a>
impl<'a> Unpin for AuthPayload<'a>
impl<'a> UnsafeUnpin for AuthPayload<'a>
impl<'a> UnwindSafe for AuthPayload<'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