pub struct Auth { /* private fields */ }
Expand description
Represents an auth header.
Implementations§
Source§impl Auth
impl Auth
Sourcepub fn from_pairs<'a, I, K, V>(pairs: I) -> Result<Auth, ParseAuthError>
pub fn from_pairs<'a, I, K, V>(pairs: I) -> Result<Auth, ParseAuthError>
Creates an auth header from key value pairs.
Sourcepub fn from_querystring(qs: &[u8]) -> Result<Auth, ParseAuthError>
pub fn from_querystring(qs: &[u8]) -> Result<Auth, ParseAuthError>
Creates an auth header from a query string.
Sourcepub fn timestamp(&self) -> Option<SystemTime>
pub fn timestamp(&self) -> Option<SystemTime>
Returns the timestamp the client defined
Sourcepub fn public_key(&self) -> &str
pub fn public_key(&self) -> &str
Returns the public key
Sourcepub fn secret_key(&self) -> Option<&str>
pub fn secret_key(&self) -> Option<&str>
Returns the client’s secret if it authenticated with a secret.
Sourcepub fn is_public(&self) -> bool
pub fn is_public(&self) -> bool
Returns true if the authentication implies public auth (no secret)
Sourcepub fn client_agent(&self) -> Option<&str>
pub fn client_agent(&self) -> Option<&str>
Returns the client’s agent
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Auth
impl<'de> Deserialize<'de> for Auth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin 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