pub struct StatusCodeExcluder { /* private fields */ }
Expand description
A StatusCodeExcluder
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. StatusCodeExcluder
differs from
StatusCodeSelector
in the defaults
it provides. As this is meant to exclude status codes, the default is to
keep everything.
Implementations§
Source§impl StatusCodeExcluder
impl StatusCodeExcluder
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new empty StatusCodeExcluder
.
Sourcepub fn new_from(ranges: Vec<AcceptRange>) -> Self
pub fn new_from(ranges: Vec<AcceptRange>) -> Self
Creates a new StatusCodeExcluder
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 StatusCodeExcluder
.
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 StatusCodeExcluder
contains value
.
Trait Implementations§
Source§impl Clone for StatusCodeExcluder
impl Clone for StatusCodeExcluder
Source§fn clone(&self) -> StatusCodeExcluder
fn clone(&self) -> StatusCodeExcluder
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 StatusCodeExcluder
impl Debug for StatusCodeExcluder
Source§impl Default for StatusCodeExcluder
impl Default for StatusCodeExcluder
Source§impl<'de> Deserialize<'de> for StatusCodeExcluder
impl<'de> Deserialize<'de> for StatusCodeExcluder
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 StatusCodeExcluder
impl Display for StatusCodeExcluder
Source§impl FromStr for StatusCodeExcluder
impl FromStr for StatusCodeExcluder
Source§impl PartialEq for StatusCodeExcluder
impl PartialEq for StatusCodeExcluder
impl StructuralPartialEq for StatusCodeExcluder
Auto Trait Implementations§
impl Freeze for StatusCodeExcluder
impl RefUnwindSafe for StatusCodeExcluder
impl Send for StatusCodeExcluder
impl Sync for StatusCodeExcluder
impl Unpin for StatusCodeExcluder
impl UnwindSafe for StatusCodeExcluder
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.