diff options
| author | Melonai <einebeere@gmail.com> | 2020-05-07 01:46:27 +0200 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2020-05-07 01:46:27 +0200 |
| commit | 385fcdd46b536d28094a96f3f6be0e87496277a1 (patch) | |
| tree | 837aa829979269df430a7bc651cdd4964800e4b3 /src/types.rs | |
| parent | bc42d900d956f11307d14136f8e24d7cd793b012 (diff) | |
| download | shorest-385fcdd46b536d28094a96f3f6be0e87496277a1.tar.zst shorest-385fcdd46b536d28094a96f3f6be0e87496277a1.zip | |
shortening functionality
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 |
