lastpass 0.1.0

An unofficial interface to the LastPass API.
Documentation
use super::EndpointError;
use reqwest::Client;
use serde_derive::Serialize;

/// Tell the server to invalidate a user's session, logging them out.
pub async fn logout(
    client: &Client,
    hostname: &str,
    token: &str,
) -> Result<(), EndpointError> {
    let data = Data {
        method: "cli",
        noredirect: 1,
        token,
    };
    super::send(client, hostname, "logout.php", &data).await?;

    Ok(())
}

#[derive(Debug, Serialize)]
struct Data<'a> {
    method: &'a str,
    noredirect: usize,
    token: &'a str,
}