From 385fcdd46b536d28094a96f3f6be0e87496277a1 Mon Sep 17 00:00:00 2001 From: Melonai Date: Thu, 7 May 2020 01:46:27 +0200 Subject: shortening functionality --- src/types.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/types.rs') 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>; \ No newline at end of file -- cgit 1.4.1