mirror of https://github.com/zkat/cacache-rs.git
BREAKING CHANGE: this bumps the MSRV to 1.70.0 --------- Co-authored-by: Kat Marchán <kzm@zkat.tech>
This commit is contained in:
parent
0ac9fb8cd9
commit
ffa1ab7254
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
rust: [1.67.0, stable]
|
rust: [1.70.0, stable]
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,8 @@ use std::pin::Pin;
|
||||||
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
#[cfg(feature = "async-std")]
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
use futures::io::AsyncReadExt;
|
use crate::async_lib::AsyncReadExt;
|
||||||
#[cfg(feature = "tokio")]
|
|
||||||
use tokio::io::AsyncReadExt;
|
|
||||||
|
|
||||||
use ssri::{Algorithm, Integrity, IntegrityChecker};
|
use ssri::{Algorithm, Integrity, IntegrityChecker};
|
||||||
|
|
||||||
|
|
@ -162,6 +160,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>,
|
||||||
|
|
@ -391,6 +393,7 @@ where
|
||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
pub async fn reflink_hash<P, Q>(cache: P, sri: &Integrity, to: Q) -> Result<()>
|
pub async fn reflink_hash<P, Q>(cache: P, sri: &Integrity, 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>,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
use crate::async_lib::AsyncRead;
|
use crate::async_lib::AsyncRead;
|
||||||
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
|
use crate::async_lib::AsyncReadExt;
|
||||||
use crate::content::linkto;
|
use crate::content::linkto;
|
||||||
use crate::errors::{Error, IoErrorExt, Result};
|
use crate::errors::{Error, IoErrorExt, Result};
|
||||||
use crate::{index, WriteOpts};
|
use crate::{index, WriteOpts};
|
||||||
|
|
@ -11,11 +13,6 @@ use std::pin::Pin;
|
||||||
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
use std::task::{Context as TaskContext, Poll};
|
use std::task::{Context as TaskContext, Poll};
|
||||||
|
|
||||||
#[cfg(feature = "async-std")]
|
|
||||||
use futures::io::AsyncReadExt;
|
|
||||||
#[cfg(feature = "tokio")]
|
|
||||||
use tokio::io::AsyncReadExt;
|
|
||||||
|
|
||||||
const BUF_SIZE: usize = 16 * 1024;
|
const BUF_SIZE: usize = 16 * 1024;
|
||||||
const PROBE_SIZE: usize = 8;
|
const PROBE_SIZE: usize = 8;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue