pub enum Fetched {
Body(Vec<u8>),
Unreachable(String),
}Expand description
What the probe received: a body, or nothing and the reason. Nothing received is carried as a value rather than an error, because “the site could not be reached” is an answer the judgement acts on.
use majordomus_cli::served::Fetched;
let got = Fetched::Unreachable("curl exited 7".into());
assert!(matches!(got, Fetched::Unreachable(ref why) if why.contains("7")));
assert!(matches!(Fetched::Body(b"{}".to_vec()), Fetched::Body(_)));Variants§
Trait Implementations§
impl Eq for Fetched
impl StructuralPartialEq for Fetched
Auto Trait Implementations§
impl Freeze for Fetched
impl RefUnwindSafe for Fetched
impl Send for Fetched
impl Sync for Fetched
impl Unpin for Fetched
impl UnsafeUnpin for Fetched
impl UnwindSafe for Fetched
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.