Added defolt auth w/o ref token

This commit is contained in:
2024-01-20 13:45:06 +05:00
parent aa4db89f97
commit 1577486736
5 changed files with 2242 additions and 3 deletions

38
src/type_users.rs Normal file
View File

@ -0,0 +1,38 @@
use skytable::{
query::SQParam,
response::{FromResponse, Response},
ClientResult,
};
pub struct Users {
pub login: String,
pub uuid: String,
pub password: String,
pub email: String,
}
impl Users {
pub fn new(login: String, uuid: String, password: String, email: String) -> Self {
Self {
login,
uuid,
password,
email,
}
}
}
impl SQParam for Users {
fn append_param(&self, q: &mut Vec<u8>) -> usize {
self.login.append_param(q)
+ self.uuid.append_param(q)
}
}
impl FromResponse for Users {
fn from_response(resp: Response) -> ClientResult<Self> {
let (login, uuid, password, email) = FromResponse::from_response(resp)?;
Ok(Self::new(login, uuid, password, email))
}
}