pub struct BasicAuthExtractor { /* private fields */ }
Expand description
Extracts basic auth credentials from a given URI.
Credentials are extracted if the URI matches one of the provided
BasicAuthSelector
instances.
Implementations§
Source§impl BasicAuthExtractor
impl BasicAuthExtractor
Sourcepub fn new<T: AsRef<[BasicAuthSelector]>>(
selectors: T,
) -> Result<Self, BasicAuthExtractorError>
pub fn new<T: AsRef<[BasicAuthSelector]>>( selectors: T, ) -> Result<Self, BasicAuthExtractorError>
Creates a new BasicAuthExtractor
from a list of BasicAuthSelector
instances.
§Errors
Returns an error if the provided BasicAuthSelector
instances contain
invalid regular expressions.
§Examples
use lychee_lib::{BasicAuthExtractor, BasicAuthSelector};
use std::str::FromStr;
let selectors = vec![
BasicAuthSelector::from_str("http://example.com foo:bar").unwrap(),
];
let extractor = BasicAuthExtractor::new(selectors).unwrap();
Trait Implementations§
Source§impl Clone for BasicAuthExtractor
impl Clone for BasicAuthExtractor
Source§fn clone(&self) -> BasicAuthExtractor
fn clone(&self) -> BasicAuthExtractor
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for BasicAuthExtractor
impl RefUnwindSafe for BasicAuthExtractor
impl Send for BasicAuthExtractor
impl Sync for BasicAuthExtractor
impl Unpin for BasicAuthExtractor
impl UnwindSafe for BasicAuthExtractor
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more