Enum MatchError

enum MatchError

A failed match attempt.

use matchit::{MatchError, Router};
# fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut router = Router::new();
router.insert("/home", "Welcome!")?;
router.insert("/blog", "Our blog.")?;

// no routes match
if let Err(err) = router.at("/blo") {
    assert_eq!(err, MatchError::NotFound);
}
# Ok(())
# }

Variants

NotFound

No matching route was found.

Implementations

impl Clone for MatchError

fn clone(self: &Self) -> MatchError

impl Copy for MatchError

impl Debug for MatchError

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Display for MatchError

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for MatchError

impl Error for MatchError

impl Freeze for MatchError

impl PartialEq for MatchError

fn eq(self: &Self, other: &MatchError) -> bool

impl RefUnwindSafe for MatchError

impl Send for MatchError

impl StructuralPartialEq for MatchError

impl Sync for MatchError

impl Unpin for MatchError

impl UnsafeUnpin for MatchError

impl UnwindSafe for MatchError

impl<T> Any for MatchError

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for MatchError

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for MatchError

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for MatchError

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for MatchError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for MatchError

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for MatchError

fn to_string(self: &Self) -> String

impl<T, U> Into for MatchError

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for MatchError

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for MatchError

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>