about summary refs log tree commit diff
path: root/src/types.rs
diff options
context:
space:
mode:
authorMelonai <einebeere@gmail.com>2020-05-07 01:46:27 +0200
committerMelonai <einebeere@gmail.com>2020-05-07 01:46:27 +0200
commit385fcdd46b536d28094a96f3f6be0e87496277a1 (patch)
tree837aa829979269df430a7bc651cdd4964800e4b3 /src/types.rs
parentbc42d900d956f11307d14136f8e24d7cd793b012 (diff)
downloadshorest-385fcdd46b536d28094a96f3f6be0e87496277a1.tar.zst
shorest-385fcdd46b536d28094a96f3f6be0e87496277a1.zip
shortening functionality
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/types.rs b/src/types.rs
index e69de29..d068043 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -0,0 +1,22 @@
+use diesel::PgConnection;
+use diesel::r2d2::{ConnectionManager, Pool};
+use crate::schema::links;
+
+#[derive(Debug, Deserialize)]
+pub struct UserData {
+    pub url: String
+}
+
+#[derive(Debug, Serialize)]
+pub struct UserResponse {
+    pub hash: String,
+}
+
+#[derive(Queryable, Insertable)]
+#[table_name="links"]
+pub struct Entry {
+    pub hash: String,
+    pub url: String
+}
+
+pub type PoolState = Pool<ConnectionManager<PgConnection>>;
\ No newline at end of file