pub enum CacheType {
Memory,
}Expand description
Cache type configuration
Variants§
Memory
In-memory cache (non-persistent, cleared on restart)
Implementations§
Source§impl CacheType
impl CacheType
Sourcepub fn from_env() -> Result<Self, CacheError>
pub fn from_env() -> Result<Self, CacheError>
Create cache configuration from environment variables
§Environment Variables
ZLAYER_CACHE_TYPE: Cache type - “memory”, “persistent”, or “s3” (default: “persistent”)ZLAYER_CACHE_DIR: Path for persistent cache directory (default: platform-specific, seezlayer_paths)ZLAYER_S3_BUCKET: S3 bucket name (required for s3 type)ZLAYER_S3_REGION: AWS region (optional)ZLAYER_S3_ENDPOINT: Custom S3 endpoint for S3-compatible servicesZLAYER_S3_PREFIX: Key prefix for blobs (default: “zlayer/blobs/”)ZLAYER_S3_PATH_STYLE: Set to “true” to use path-style URLs
§Errors
Returns CacheError if:
ZLAYER_CACHE_TYPEis “s3” butZLAYER_S3_BUCKETis not setZLAYER_CACHE_TYPEis an unknown value
Sourcepub async fn build(&self) -> Result<Arc<Box<dyn BlobCacheBackend>>, CacheError>
pub async fn build(&self) -> Result<Arc<Box<dyn BlobCacheBackend>>, CacheError>
Build a cache backend from this configuration
§Errors
Returns CacheError if the cache backend fails to initialize
Trait Implementations§
Auto Trait Implementations§
impl Forget for CacheType
impl Freeze for CacheType
impl Move for CacheType
impl RefUnwindSafe for CacheType
impl Send for CacheType
impl Sync for CacheType
impl Unpin for CacheType
impl UnsafeUnpin for CacheType
impl UnwindSafe for CacheType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more