use crate::{proxy::Proxy, Error};
#[derive(Debug)]
#[doc(alias = "org.freedesktop.portal.ProxyResolver")]
pub struct ProxyResolver<'a>(Proxy<'a>);
impl<'a> ProxyResolver<'a> {
pub async fn new() -> Result<ProxyResolver<'a>, Error> {
let proxy = Proxy::new_desktop("org.freedesktop.portal.ProxyResolver").await?;
Ok(Self(proxy))
}
#[doc(alias = "Lookup")]
pub async fn lookup(&self, uri: &url::Url) -> Result<Vec<url::Url>, Error> {
self.0.call("Lookup", &(uri)).await
}
}
impl<'a> std::ops::Deref for ProxyResolver<'a> {
type Target = zbus::Proxy<'a>;
fn deref(&self) -> &Self::Target {
&self.0
}
}