From 582124d59afa438e2cb88cc024d6b19232236e1e Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sat, 12 Jun 2021 21:06:06 -0600 Subject: stub out basic implementation --- src/contrib/admin/mod.rs | 1 + src/contrib/admin/site/mod.rs | 1 + src/contrib/admin/site/urls.rs | 3 +++ src/contrib/mod.rs | 1 + src/http/mod.rs | 3 +++ src/lib.rs | 12 ++++++------ src/urls/mod.rs | 16 ++++++++++++++++ 7 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 src/contrib/admin/mod.rs create mode 100644 src/contrib/admin/site/mod.rs create mode 100644 src/contrib/admin/site/urls.rs create mode 100644 src/contrib/mod.rs create mode 100644 src/http/mod.rs create mode 100644 src/urls/mod.rs (limited to 'src') 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); diff --git a/src/lib.rs b/src/lib.rs index 31e1bb2..28e6ab9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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], + }, +} -- cgit v1.2.3