diff options
Diffstat (limited to 'src/models.rs')
-rw-r--r-- | src/models.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/models.rs b/src/models.rs index b367f4f..2295154 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,8 +1,6 @@ -use sqlx::FromRow; +use sqlx::{FromRow, types::ipnetwork::IpNetwork}; - - -#[derive(Debug, FromRow)] +#[derive(Debug, FromRow, Clone)] pub struct DbUser { pub id: String, pub email: String, @@ -10,3 +8,17 @@ pub struct DbUser { pub pw_hash: String, pub last_login: chrono::NaiveDateTime } + +#[derive(Debug, FromRow, Clone)] +pub struct Peer { + pub id: String, + pub addr: IpNetwork, + pub public_key: String, +} + +#[derive(Debug, FromRow, Clone)] +pub struct Network { + pub id: String, + pub subnet: IpNetwork, + pub description: Option<String> +} |