diff options
author | FxQnLr <[email protected]> | 2024-02-18 21:16:46 +0100 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-02-18 21:16:46 +0100 |
commit | 2f9f18b80a9e2134f674f345e48a5f21de5efadd (patch) | |
tree | c4202bb5c1a490233e89d928cf8c5b91258d4c90 /src/db.rs | |
parent | 016fa3a31f8847d3f52800941b7f8fe5ef872240 (diff) | |
download | webol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.tar webol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.tar.gz webol-2f9f18b80a9e2134f674f345e48a5f21de5efadd.zip |
Refactor stuff. Use Postgres Types
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,13 +1,13 @@ | |||
1 | use serde::Serialize; | 1 | use serde::Serialize; |
2 | use sqlx::{PgPool, postgres::PgPoolOptions}; | 2 | use sqlx::{PgPool, postgres::PgPoolOptions, types::{ipnetwork::IpNetwork, mac_address::MacAddress}}; |
3 | use tracing::{debug, info}; | 3 | use tracing::{debug, info}; |
4 | 4 | ||
5 | #[derive(Serialize, Debug)] | 5 | #[derive(Serialize, Debug)] |
6 | pub struct Device { | 6 | pub struct Device { |
7 | pub id: String, | 7 | pub id: String, |
8 | pub mac: String, | 8 | pub mac: MacAddress, |
9 | pub broadcast_addr: String, | 9 | pub broadcast_addr: String, |
10 | pub ip: String, | 10 | pub ip: IpNetwork, |
11 | pub times: Option<Vec<i64>> | 11 | pub times: Option<Vec<i64>> |
12 | } | 12 | } |
13 | 13 | ||