mikrotik 0.0.8

REST API Wrapper for Mikrotik API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod types;
pub mod wireguard;

pub use crate::interface::types::{Interface, InterfaceType, Mtu};
use crate::{Client, ClientError};

const BASE: &str = "rest/interface";

pub async fn list(client: &mut Client) -> Result<Vec<Interface>, ClientError> {
    client.execute_get::<Vec<Interface>>(BASE).await
}

pub async fn get(client: &mut Client, ifid: &str) -> Result<Interface, ClientError> {
    let url = format!("{}/{}", BASE, ifid);

    client.execute_get::<Interface>(&url).await
}