Struct ocipkg::distribution::AuthChallenge
source · pub struct AuthChallenge {
pub url: String,
pub service: String,
pub scope: String,
}
Expand description
WWW-Authentication challenge
use ocipkg::distribution::AuthChallenge;
let auth = AuthChallenge::from_header(
r#"Bearer realm="https://ghcr.io/token",service="ghcr.io",scope="repository:termoshtt/ocipkg/rust-lib:pull""#,
).unwrap();
assert_eq!(auth, AuthChallenge {
url: "https://ghcr.io/token".to_string(),
service: "ghcr.io".to_string(),
scope: "repository:termoshtt/ocipkg/rust-lib:pull".to_string(),
});
Fields§
§url: String
§service: String
§scope: String
Implementations§
source§impl AuthChallenge
impl AuthChallenge
pub fn from_header(header: &str) -> Result<Self>
Trait Implementations§
source§impl Clone for AuthChallenge
impl Clone for AuthChallenge
source§fn clone(&self) -> AuthChallenge
fn clone(&self) -> AuthChallenge
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AuthChallenge
impl Debug for AuthChallenge
source§impl PartialEq for AuthChallenge
impl PartialEq for AuthChallenge
source§fn eq(&self, other: &AuthChallenge) -> bool
fn eq(&self, other: &AuthChallenge) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for AuthChallenge
impl StructuralPartialEq for AuthChallenge
Auto Trait Implementations§
impl Freeze for AuthChallenge
impl RefUnwindSafe for AuthChallenge
impl Send for AuthChallenge
impl Sync for AuthChallenge
impl Unpin for AuthChallenge
impl UnwindSafe for AuthChallenge
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.