Enum lychee_lib::Status
source · [−]pub enum Status {
Ok(StatusCode),
Error(ErrorKind),
Timeout(Option<StatusCode>),
Redirected(StatusCode),
UnknownStatusCode(StatusCode),
Excluded,
Unsupported(ErrorKind),
Cached(CacheStatus),
}
Expand description
Response status of the request.
Variants
Ok(StatusCode)
Request was successful
Error(ErrorKind)
Failed request
Timeout(Option<StatusCode>)
Request timed out
Redirected(StatusCode)
Got redirected to different resource
UnknownStatusCode(StatusCode)
The given status code is not known by lychee
Excluded
Resource was excluded from checking
Unsupported(ErrorKind)
The request type is currently not supported,
for example when the URL scheme is slack://
or file://
See https://github.com/lycheeverse/lychee/issues/199
Cached(CacheStatus)
Cached request status from previous run
Implementations
sourceimpl Status
impl Status
sourcepub fn new(response: &Response, accepted: Option<HashSet<StatusCode>>) -> Self
pub fn new(response: &Response, accepted: Option<HashSet<StatusCode>>) -> Self
Create a status object from a response and the set of accepted status codes
sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Returns true
if the check was successful
sourcepub const fn is_failure(&self) -> bool
pub const fn is_failure(&self) -> bool
Returns true
if the check was not successful
sourcepub const fn is_excluded(&self) -> bool
pub const fn is_excluded(&self) -> bool
Returns true
if the check was excluded
sourcepub const fn is_timeout(&self) -> bool
pub const fn is_timeout(&self) -> bool
Returns true
if a check took too long to complete
sourcepub const fn is_unsupported(&self) -> bool
pub const fn is_unsupported(&self) -> bool
Returns true
if a URI is unsupported
Trait Implementations
sourceimpl From<&'_ Status> for CacheStatus
impl From<&'_ Status> for CacheStatus
sourceimpl From<CacheStatus> for Status
impl From<CacheStatus> for Status
sourcefn from(s: CacheStatus) -> Self
fn from(s: CacheStatus) -> Self
Converts to this type from the input type.
impl Eq for Status
impl StructuralEq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations
impl !RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl !UnwindSafe for Status
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more