pub struct Client { /* private fields */ }Expand description
Handles incoming requests and returns responses.
See ClientBuilder which contains sane defaults for all configuration
options.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn check<T, E>(&self, request: T) -> Result<Response>
pub async fn check<T, E>(&self, request: T) -> Result<Response>
Check a single request.
request can be either a Request or a type that can be converted
into it. In any case, it must represent a valid URI.
§Errors
Returns an Err if:
requestdoes not represent a valid URI.- Encrypted connection for a HTTP URL is available but unused. (Only
checked when
Client::require_httpsistrue.)
Sourcepub async fn check_file(&self, uri: &Uri) -> Status
pub async fn check_file(&self, uri: &Uri) -> Status
Check a single file using the file checker.
Sourcepub fn remap(&self, uri: &mut Uri) -> Result<()>
pub fn remap(&self, uri: &mut Uri) -> Result<()>
Remap uri using the client-defined remapping rules.
§Errors
Returns an Err if the final, remapped uri is not a valid URI.
Sourcepub fn is_excluded(&self, uri: &Uri) -> bool
pub fn is_excluded(&self, uri: &Uri) -> bool
Returns whether the given uri should be ignored from checking.
Sourcepub async fn check_website(
&self,
uri: &Uri,
credentials: Option<BasicAuthCredentials>,
) -> Result<Status>
pub async fn check_website( &self, uri: &Uri, credentials: Option<BasicAuthCredentials>, ) -> Result<Status>
Checks the given URI of a website.
§Errors
This returns an Err if
- The URI is invalid.
- The request failed.
- The response status code is not accepted.
- The URI cannot be converted to HTTPS.
Sourcepub async fn check_mail(&self, uri: &Uri) -> Status
pub async fn check_mail(&self, uri: &Uri) -> Status
Checks a mailto URI.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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