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<Auth, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Auth, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Auth
impl Serialize for Auth
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)