Struct lychee_lib::BasicAuthExtractor
source · 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 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 moreAuto Trait Implementations§
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