session-open-group-server/src/models.rs
2021-03-10 14:21:44 +11:00

24 lines
No EOL
473 B
Rust

use serde::{Deserialize, Serialize};
#[derive(Debug)]
pub struct ValidationError;
impl warp::reject::Reject for ValidationError { }
#[derive(Deserialize, Serialize, Debug)]
pub struct Message {
pub server_id: Option<i64>,
pub text: String
}
impl Message {
pub fn is_valid(&self) -> bool {
return !self.text.is_empty();
}
}
#[derive(Debug, Deserialize)]
pub struct QueryOptions {
pub limit: Option<u16>,
pub from_server_id: Option<i64>
}