use crate::Router;
pub struct RouterBuilder<S = ()> {
_marker: std::marker::PhantomData<S>,
}
impl<S> RouterBuilder<S>
where
S: Clone + Send + Sync + 'static,
{
pub fn new() -> Self
where
S: Default,
{
Self { _marker: std::marker::PhantomData }
}
pub fn from_router(_router: Router) -> Self {
Self { _marker: std::marker::PhantomData }
}
pub fn route(self, _path: &str, _method_router: MethodRouter<S>) -> Self {
self
}
pub fn nest(self, _path: &str, _router: Router) -> Self {
self
}
pub fn merge(self, _router: Router) -> Self {
self
}
pub fn get<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn post<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn put<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn delete<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn patch<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn options<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn head<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn trace<H, T>(self, _path: &str, _handler: H) -> Self
where
T: 'static,
{
self
}
pub fn build(self) -> Router {
Router::new()
}
pub fn into_inner(self) -> Router {
self.build()
}
}
impl<S> Default for RouterBuilder<S>
where
S: Clone + Send + Sync + 'static + Default,
{
fn default() -> Self {
Self::new()
}
}
impl<S> From<Router> for RouterBuilder<S>
where
S: Clone + Send + Sync + 'static,
{
fn from(router: Router) -> Self {
Self::from_router(router)
}
}
impl<S> From<RouterBuilder<S>> for Router
where
S: Clone + Send + Sync + 'static,
{
fn from(builder: RouterBuilder<S>) -> Self {
builder.build()
}
}
pub struct MethodRouter<S = ()> {
_marker: std::marker::PhantomData<S>,
}
impl<S> Clone for MethodRouter<S> {
fn clone(&self) -> Self {
Self { _marker: std::marker::PhantomData }
}
}
impl<S> Default for MethodRouter<S> {
fn default() -> Self {
Self { _marker: std::marker::PhantomData }
}
}
pub fn get<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn post<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn put<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn delete<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn patch<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn options<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn head<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn trace<H, T, S>(_handler: H) -> MethodRouter<S>
where
T: 'static,
{
MethodRouter::default()
}
pub fn health_check_router() -> Router {
Router::new()
}