use mikrotik_lite::MikrotikLite; use serde::{Deserialize}; use serde_aux::prelude::{deserialize_bool_from_anything}; fn main() { let mut api = MikrotikLite::new( "api_login".to_string(), "api_pass".to_string(), "10.80.80.1:8728".to_string(), ).unwrap(); let identity_json = api.send_command::( "/ip/route/print".to_string(), None ).unwrap(); println!("{:#?}", identity_json); } #[allow(dead_code)] #[derive(Debug, Deserialize)] struct Route { #[serde(rename = "dst-address")] pub dst_address: String, #[serde(rename = ".id")] pub id: String, #[serde(deserialize_with = "deserialize_bool_from_anything")] pub inactive: bool, #[serde(rename = "routing-table")] pub routing_table: String, pub gateway: String, #[serde(rename = "local-address")] pub local_address: Option, #[serde(rename = "immediate-gw")] pub immediate_gw: Option }