use std::fmt;
use std::pin::Pin;
use std::time::Duration;
use async_trait::async_trait;
use crate::models::ArtifactRef;
use crate::Result;
#[async_trait]
pub trait ArtifactStore: Send + Sync + fmt::Debug {
async fn put(
&self,
reader: Pin<Box<dyn tokio::io::AsyncRead + Send>>,
) -> Result<ArtifactRef>;
async fn get(
&self,
digest: &str,
) -> Result<Option<Pin<Box<dyn tokio::io::AsyncRead + Send>>>>;
async fn exists(&self, digest: &str) -> bool;
fn default_expiry(&self) -> Option<Duration> {
Some(Duration::from_secs(7 * 24 * 60 * 60)) }
}