diff options
Diffstat (limited to 'src/types.rs')
| -rw-r--r-- | src/types.rs | 22 |
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 |
