Feature flags added

This commit is contained in:
kinire98 2024-02-09 17:56:58 +01:00
parent 0ac9fb8cd9
commit 95e21db6e9
3 changed files with 4 additions and 0 deletions

View File

@ -162,6 +162,7 @@ pub fn reflink(cache: &Path, sri: &Integrity, to: &Path) -> Result<()> {
reflink_unchecked(cache, sri, to) reflink_unchecked(cache, sri, to)
} }
#[cfg(any(feature = "async-std", feature = "tokio"))]
pub async fn reflink_async(cache: &Path, sri: &Integrity, to: &Path) -> Result<()> { pub async fn reflink_async(cache: &Path, sri: &Integrity, to: &Path) -> Result<()> {
let mut reader = open_async(cache, sri.clone()).await?; let mut reader = open_async(cache, sri.clone()).await?;
let mut buf = [0u8; 1024 * 8]; let mut buf = [0u8; 1024 * 8];

View File

@ -319,6 +319,7 @@ where
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[cfg(any(feature = "async-std", feature = "tokio"))]
pub async fn reflink<P, K, Q>(cache: P, key: K, to: Q) -> Result<()> pub async fn reflink<P, K, Q>(cache: P, key: K, to: Q) -> Result<()>
where where
P: AsRef<Path>, P: AsRef<Path>,
@ -355,6 +356,7 @@ where
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```
#[cfg(any(feature = "async-std", feature = "tokio"))]
pub async fn reflink_unchecked<P, K, Q>(cache: P, key: K, to: Q) -> Result<()> pub async fn reflink_unchecked<P, K, Q>(cache: P, key: K, to: Q) -> Result<()>
where where
P: AsRef<Path>, P: AsRef<Path>,

View File

@ -414,6 +414,7 @@ impl RemoveOpts {
} }
/// Removes an individual index metadata entry. The associated content will be left in the cache. /// Removes an individual index metadata entry. The associated content will be left in the cache.
#[cfg(any(feature = "async-std", feature = "tokio"))]
pub async fn remove<P, K>(self, cache: P, key: K) -> Result<()> pub async fn remove<P, K>(self, cache: P, key: K) -> Result<()>
where where
P: AsRef<Path>, P: AsRef<Path>,