diff options
author | Melody Horn / boringcactus <melody@boringcactus.com> | 2021-06-12 21:06:06 -0600 |
---|---|---|
committer | Melody Horn / boringcactus <melody@boringcactus.com> | 2021-06-12 21:06:06 -0600 |
commit | 582124d59afa438e2cb88cc024d6b19232236e1e (patch) | |
tree | 6b1bc48d5e3a405434f4900c7e20daf0d186de5a /src | |
parent | fcc13328ff82326d25e39504732701b27f894e22 (diff) | |
download | tosin-582124d59afa438e2cb88cc024d6b19232236e1e.tar.gz tosin-582124d59afa438e2cb88cc024d6b19232236e1e.zip |
stub out basic implementation
Diffstat (limited to 'src')
-rw-r--r-- | src/contrib/admin/mod.rs | 1 | ||||
-rw-r--r-- | src/contrib/admin/site/mod.rs | 1 | ||||
-rw-r--r-- | src/contrib/admin/site/urls.rs | 3 | ||||
-rw-r--r-- | src/contrib/mod.rs | 1 | ||||
-rw-r--r-- | src/http/mod.rs | 3 | ||||
-rw-r--r-- | src/lib.rs | 12 | ||||
-rw-r--r-- | src/urls/mod.rs | 16 |
7 files changed, 31 insertions, 6 deletions
diff --git a/src/contrib/admin/mod.rs b/src/contrib/admin/mod.rs new file mode 100644 index 0000000..4d481aa --- /dev/null +++ b/src/contrib/admin/mod.rs @@ -0,0 +1 @@ +pub mod site; diff --git a/src/contrib/admin/site/mod.rs b/src/contrib/admin/site/mod.rs new file mode 100644 index 0000000..c8faf42 --- /dev/null +++ b/src/contrib/admin/site/mod.rs @@ -0,0 +1 @@ +pub mod urls; diff --git a/src/contrib/admin/site/urls.rs b/src/contrib/admin/site/urls.rs new file mode 100644 index 0000000..5e81c4e --- /dev/null +++ b/src/contrib/admin/site/urls.rs @@ -0,0 +1,3 @@ +use crate::urls::Path; + +pub const URL_PATTERNS: &[Path] = &[]; diff --git a/src/contrib/mod.rs b/src/contrib/mod.rs new file mode 100644 index 0000000..92918b0 --- /dev/null +++ b/src/contrib/mod.rs @@ -0,0 +1 @@ +pub mod admin; diff --git a/src/http/mod.rs b/src/http/mod.rs new file mode 100644 index 0000000..69a0706 --- /dev/null +++ b/src/http/mod.rs @@ -0,0 +1,3 @@ +pub struct Request {} + +pub struct Response(pub &'static str); @@ -1,7 +1,7 @@ -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); - } +pub mod contrib; +pub mod http; +pub mod urls; + +pub fn run_server(url_patterns: &[urls::Path]) { + todo!(); } diff --git a/src/urls/mod.rs b/src/urls/mod.rs new file mode 100644 index 0000000..1acf186 --- /dev/null +++ b/src/urls/mod.rs @@ -0,0 +1,16 @@ +use crate::http::{Request, Response}; + +pub type View = fn(Request) -> Response; + +pub enum Path { + View { + url: &'static str, + view: View, + name: &'static str, + }, + + Include { + url: &'static str, + content: &'static [Path], + }, +} |