pub struct Request {
pub uri: Uri,
pub source: ResolvedInputSource,
pub element: Option<String>,
pub attribute: Option<String>,
pub span: Option<RawUriSpan>,
pub credentials: Option<BasicAuthCredentials>,
}Expand description
A checkable element extracted from a ResolvedInputSource,
containing a Uri and additional metadata associated with it.
Fields§
§uri: UriThe extracted Uniform Resource Identifier which can be checked with lychee
source: ResolvedInputSourceThe resource which contains the given URI
element: Option<String>How the URI is rendered inside a document
(for example img, a, pre, or code).
In case of plaintext input the field is None.
attribute: Option<String>What attribute (e.g. href) the URI is contained in
span: Option<RawUriSpan>Where the URI is located
credentials: Option<BasicAuthCredentials>Basic auth credentials
Implementations§
Source§impl Request
impl Request
Sourcepub const fn new(uri: Uri, source: ResolvedInputSource) -> Self
pub const fn new(uri: Uri, source: ResolvedInputSource) -> Self
Instantiate a new Request object,
with optional fields set to None
Sourcepub fn with_element(self, element: String) -> Self
pub fn with_element(self, element: String) -> Self
Set Self::element
Sourcepub fn with_attribute(self, attribute: String) -> Self
pub fn with_attribute(self, attribute: String) -> Self
Set Self::attribute
Sourcepub const fn with_span(self, span: RawUriSpan) -> Self
pub const fn with_span(self, span: RawUriSpan) -> Self
Set Self::span
Sourcepub fn with_credentials(self, credentials: BasicAuthCredentials) -> Self
pub fn with_credentials(self, credentials: BasicAuthCredentials) -> Self
Trait Implementations§
impl Eq for Request
impl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.