-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bab4c8
commit a97f192
Showing
12 changed files
with
142 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use crate::Route; | ||
use errors::{MethodDeleteError, MethodInsertError, MethodSearchError}; | ||
use http::Method; | ||
|
||
pub mod errors; | ||
|
||
#[derive(Clone, Debug, Eq, PartialEq)] | ||
pub enum MethodData<T> {} | ||
|
||
#[derive(Debug, Eq, PartialEq)] | ||
pub struct PathMatch<T> {} | ||
|
||
#[derive(Clone)] | ||
pub struct MethodRouter<T> {} | ||
|
||
impl<T> MethodRouter<T> { | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
|
||
pub fn insert<'r>( | ||
&mut self, | ||
route: &Route<'r>, | ||
value: Option<T>, | ||
) -> Result<(), MethodInsertError> { | ||
Ok(()) | ||
} | ||
|
||
pub fn delete<'r>(&mut self, route: &Route<'r>) -> Result<MethodData<T>, MethodDeleteError> { | ||
Ok(()) | ||
} | ||
|
||
pub fn search(&self, method: Method) -> Result<Option<MethodMatch<T>>, MethodSearchError> { | ||
Ok(None) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pub mod delete; | ||
pub use delete::MethodDeleteError; | ||
|
||
pub mod insert; | ||
pub use insert::MethodInsertError; | ||
|
||
pub mod search; | ||
pub use search::MethodSearchError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use core::{error::Error, fmt::Display}; | ||
|
||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum MethodDeleteError {} | ||
|
||
impl Error for MethodDeleteError {} | ||
|
||
impl Display for MethodDeleteError { | ||
fn fmt(&self, _: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use core::{error::Error, fmt::Display}; | ||
|
||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum MethodInsertError {} | ||
|
||
impl Error for MethodInsertError {} | ||
|
||
impl Display for MethodInsertError { | ||
fn fmt(&self, _: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use core::{error::Error, fmt::Display}; | ||
|
||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum MethodSearchError {} | ||
|
||
impl Error for MethodSearchError {} | ||
|
||
impl Display for MethodSearchError { | ||
fn fmt(&self, _: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters