use skytable::{ query::SQParam, response::{FromResponse, Response}, ClientResult, }; pub struct Sites { pub uuid: String, pub uid: String, pub domain: String, pub pkey: Vec, pub skey: Vec, } impl Sites { pub fn new(uuid: String, uid: String, domain: String, pkey: Vec, skey: Vec) -> Self { Self { uuid, uid, domain, pkey, skey, } } } impl SQParam for Sites { fn append_param(&self, q: &mut Vec) -> usize { self.uuid.append_param(q) + self.domain.append_param(q) } } impl FromResponse for Sites { fn from_response(resp: Response) -> ClientResult { let (uuid, uid, domain, pkey, skey) = FromResponse::from_response(resp)?; Ok(Self::new(uuid, uid, domain, pkey, skey)) } }