pub struct StatusCodeSelector { /* private fields */ }
Expand description
A StatusCodeSelector
holds ranges of HTTP status codes, and determines
whether a specific code is matched, so the link can be counted as valid (not
broken) or excluded. StatusCodeSelector
differs from
StatusCodeExcluder
in the defaults it provides. As this is meant to
select valid status codes, the default includes every successful status.
Implementations§
Source§impl StatusCodeSelector
impl StatusCodeSelector
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new empty StatusCodeSelector
.
Sourcepub fn new_from(ranges: Vec<AcceptRange>) -> Self
pub fn new_from(ranges: Vec<AcceptRange>) -> Self
Creates a new StatusCodeSelector
prefilled with ranges
.
Sourcepub fn add_range(&mut self, range: AcceptRange) -> &mut Self
pub fn add_range(&mut self, range: AcceptRange) -> &mut Self
Adds a range of HTTP status codes to this StatusCodeSelector
.
This method merges the new and existing ranges if they overlap.
Sourcepub fn contains(&self, value: u16) -> bool
pub fn contains(&self, value: u16) -> bool
Returns whether this StatusCodeSelector
contains value
.
Trait Implementations§
Source§impl Clone for StatusCodeSelector
impl Clone for StatusCodeSelector
Source§fn clone(&self) -> StatusCodeSelector
fn clone(&self) -> StatusCodeSelector
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 moreSource§impl Debug for StatusCodeSelector
impl Debug for StatusCodeSelector
Source§impl Default for StatusCodeSelector
These values are the default status codes which are accepted by lychee.
impl Default for StatusCodeSelector
These values are the default status codes which are accepted by lychee.
Source§impl<'de> Deserialize<'de> for StatusCodeSelector
impl<'de> Deserialize<'de> for StatusCodeSelector
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for StatusCodeSelector
impl Display for StatusCodeSelector
Source§impl<S: BuildHasher + Default> From<StatusCodeSelector> for HashSet<u16, S>
impl<S: BuildHasher + Default> From<StatusCodeSelector> for HashSet<u16, S>
Source§fn from(value: StatusCodeSelector) -> Self
fn from(value: StatusCodeSelector) -> Self
Converts to this type from the input type.
Source§impl FromStr for StatusCodeSelector
impl FromStr for StatusCodeSelector
Source§impl PartialEq for StatusCodeSelector
impl PartialEq for StatusCodeSelector
Source§impl<S: BuildHasher + Default> TryFrom<StatusCodeSelector> for HashSet<StatusCode, S>
impl<S: BuildHasher + Default> TryFrom<StatusCodeSelector> for HashSet<StatusCode, S>
Source§type Error = InvalidStatusCode
type Error = InvalidStatusCode
The type returned in the event of a conversion error.
impl StructuralPartialEq for StatusCodeSelector
Auto Trait Implementations§
impl Freeze for StatusCodeSelector
impl RefUnwindSafe for StatusCodeSelector
impl Send for StatusCodeSelector
impl Sync for StatusCodeSelector
impl Unpin for StatusCodeSelector
impl UnwindSafe for StatusCodeSelector
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> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.