mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 16:03:31 +00:00
removed old OTS Rust structs
This commit is contained in:
@@ -73,79 +73,3 @@ pub struct Marker {
|
|||||||
pub api_address: String,
|
pub api_address: String,
|
||||||
pub api_auth_token: String,
|
pub api_auth_token: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FromArma for Marker {
|
|
||||||
fn from_arma(data: String) -> Result<Marker, FromArmaError> {
|
|
||||||
let (
|
|
||||||
uid,
|
|
||||||
latitude,
|
|
||||||
longitude,
|
|
||||||
speed,
|
|
||||||
course,
|
|
||||||
r#type,
|
|
||||||
name,
|
|
||||||
hae,
|
|
||||||
api_address,
|
|
||||||
api_auth_token,
|
|
||||||
) = <(
|
|
||||||
String,
|
|
||||||
f64,
|
|
||||||
f64,
|
|
||||||
f64,
|
|
||||||
f64,
|
|
||||||
String,
|
|
||||||
String,
|
|
||||||
f64,
|
|
||||||
String,
|
|
||||||
String
|
|
||||||
)>::from_arma(data)?;
|
|
||||||
Ok(Self {
|
|
||||||
uid,
|
|
||||||
latitude,
|
|
||||||
longitude,
|
|
||||||
speed,
|
|
||||||
course,
|
|
||||||
r#type,
|
|
||||||
name,
|
|
||||||
hae,
|
|
||||||
api_address,
|
|
||||||
api_auth_token
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
pub struct MarkerPayload {
|
|
||||||
pub uid: String,
|
|
||||||
pub longitude: f64,
|
|
||||||
pub latitude: f64,
|
|
||||||
pub name: String,
|
|
||||||
pub r#type: String,
|
|
||||||
pub course: f64,
|
|
||||||
pub speed: f64,
|
|
||||||
pub hae: f64,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
||||||
pub struct LoginPayload {
|
|
||||||
pub address: String,
|
|
||||||
pub username: String,
|
|
||||||
pub password: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
pub struct LoginInfo {
|
|
||||||
pub username: String,
|
|
||||||
pub password: String
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromArma for LoginPayload {
|
|
||||||
fn from_arma(data: String) -> Result<LoginPayload, FromArmaError> {
|
|
||||||
let (address, username, password) = <(String, String, String)>::from_arma(data)?;
|
|
||||||
Ok(Self {
|
|
||||||
address,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user