make cache pub (#418)

This commit is contained in:
Eduard S. 2025-09-15 11:43:59 +02:00 committed by GitHub
parent 5de08da32c
commit 1d14338351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

2
src/cache/disk.rs vendored
View file

@ -24,7 +24,7 @@ impl<T> Deref for CacheEntry<T> {
/// Get the artifact named `name` from the disk cache. If it doesn't exist, it will be built by /// Get the artifact named `name` from the disk cache. If it doesn't exist, it will be built by
/// calling `build_fn` and stored. /// calling `build_fn` and stored.
/// The artifact is indexed by git commit first and then by `params: P` second. /// The artifact is indexed by git commit first and then by `params: P` second.
pub(crate) fn get<T: Serialize + DeserializeOwned, P: Serialize>( pub fn get<T: Serialize + DeserializeOwned, P: Serialize>(
name: &str, name: &str,
params: &P, params: &P,
build_fn: fn(&P) -> T, build_fn: fn(&P) -> T,

2
src/cache/mem.rs vendored
View file

@ -28,7 +28,7 @@ impl<T> Deref for CacheEntry<T> {
/// Get the artifact named `name` from the memory cache. If it doesn't exist, it will be built by /// Get the artifact named `name` from the memory cache. If it doesn't exist, it will be built by
/// calling `build_fn` and stored. /// calling `build_fn` and stored.
/// The artifact is indexed by `params: P`. /// The artifact is indexed by `params: P`.
pub(crate) fn get<T: Serialize + DeserializeOwned + Sync + 'static, P: Serialize>( pub fn get<T: Serialize + DeserializeOwned + Sync + 'static, P: Serialize>(
name: &str, name: &str,
params: &P, params: &P,
build_fn: fn(&P) -> T, build_fn: fn(&P) -> T,

4
src/cache/mod.rs vendored
View file

@ -1,9 +1,9 @@
#[cfg(feature = "disk_cache")] #[cfg(feature = "disk_cache")]
mod disk; mod disk;
#[cfg(feature = "disk_cache")] #[cfg(feature = "disk_cache")]
pub(crate) use disk::{get, CacheEntry}; pub use disk::{get, CacheEntry};
#[cfg(feature = "mem_cache")] #[cfg(feature = "mem_cache")]
mod mem; mod mem;
#[cfg(feature = "mem_cache")] #[cfg(feature = "mem_cache")]
pub(crate) use mem::{get, CacheEntry}; pub use mem::{get, CacheEntry};

View file

@ -5,7 +5,7 @@
#![feature(mapped_lock_guards)] #![feature(mapped_lock_guards)]
pub mod backends; pub mod backends;
mod cache; pub mod cache;
pub mod frontend; pub mod frontend;
pub mod lang; pub mod lang;
pub mod middleware; pub mod middleware;