use crate::imp::{core::*, download::Download as Impl, prelude::*};
#[derive(Clone)]
pub struct Download {
inner: Arc<Impl>
}
impl Download {
pub(crate) fn new(inner: Arc<Impl>) -> Self { Self { inner } }
pub fn url(&self) -> &str { self.inner.url() }
pub fn suggested_filename(&self) -> &str { self.inner.suggested_filename() }
pub async fn path(&self) -> ArcResult<Option<PathBuf>> { self.inner.path().await }
pub async fn delete(&self) -> ArcResult<()> { self.inner.delete().await }
pub async fn save_as<P: AsRef<Path>>(&self, path: P) -> Result<(), Arc<Error>> {
self.inner.save_as(path).await
}
pub async fn failure(&self) -> Result<Option<String>, Arc<Error>> { self.inner.failure().await }
}