fnroute 0.1.0

A small function router with axum-style handler extraction.
Documentation
use alloc::{collections::BTreeMap, string::String, sync::Arc};
use core::any::Any;

#[derive(Clone)]
pub struct RouteContext {
    pub route: String,
    pub params: BTreeMap<String, String>,
    pub input: Option<Arc<dyn Any>>,
}

impl RouteContext {
    pub fn new(route: impl Into<String>) -> Self {
        Self {
            route: route.into(),
            params: BTreeMap::new(),
            input: None,
        }
    }

    pub fn input<T>(mut self, input: T) -> Self
    where
        T: 'static,
    {
        self.input = Some(Arc::new(input));
        self
    }
}