mirror of https://github.com/Trivernis/aur-rpc.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
548 B
Rust
23 lines
548 B
Rust
use reqwest::Client;
|
|
use serde::{de::DeserializeOwned, Serialize};
|
|
mod info;
|
|
mod search;
|
|
|
|
pub use info::*;
|
|
pub use search::*;
|
|
|
|
use crate::{error::RPCResult, models::AURResponse};
|
|
use std::fmt::Debug;
|
|
|
|
const AUR_URL: &str = "https://aur.archlinux.org/rpc/";
|
|
|
|
#[tracing::instrument(level = "debug")]
|
|
async fn call_aur<Q: Serialize + Debug + ?Sized, R: DeserializeOwned>(
|
|
args: &Q,
|
|
) -> RPCResult<AURResponse<R>> {
|
|
let client = Client::new();
|
|
let response = client.get(AUR_URL).query(args).send().await?.json().await?;
|
|
|
|
Ok(response)
|
|
}
|