mirror of https://github.com/zkat/cacache-rs.git
Feature flags added
This commit is contained in:
parent
0ac9fb8cd9
commit
95e21db6e9
|
|
@ -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];
|
||||||
|
|
|
||||||
|
|
@ -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>,
|
||||||
|
|
|
||||||
|
|
@ -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>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue