aur-rpc 0.2.2

An async wrapper for aur RPC calls
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{error::RPCResult, models::PackageInfo};

/// Returns information about the given list of packages
pub async fn info<I: IntoIterator<Item = S>, S: AsRef<str>>(
    packages: I,
) -> RPCResult<Vec<PackageInfo>> {
    let mut args: Vec<(&str, String)> = packages
        .into_iter()
        .map(|p| ("arg[]", p.as_ref().to_string()))
        .collect();
    args.push(("v", String::from("5")));
    args.push(("type", String::from("info")));
    let response = super::call_aur::<_, PackageInfo>(&args).await?;

    Ok(response.results)
}