pub struct LayerStorageConfig {
pub bucket: String,
pub prefix: String,
pub region: Option<String>,
pub endpoint_url: Option<String>,
pub staging_dir: PathBuf,
pub state_db_path: PathBuf,
pub part_size_bytes: u64,
pub max_concurrent_uploads: usize,
pub compression_level: i32,
pub sync_interval_secs: u64,
}Expand description
Configuration for S3-backed layer storage
Fields§
§bucket: StringS3 bucket name for storing layers
prefix: StringS3 key prefix for layer objects (e.g., “layers/”)
region: Option<String>AWS region (if not using environment/profile defaults)
endpoint_url: Option<String>Custom S3 endpoint URL (for S3-compatible storage like MinIO)
staging_dir: PathBufLocal directory for staging tarballs before upload
state_db_path: PathBufLocal database path for sync state persistence
part_size_bytes: u64Multipart upload part size in bytes (default: 64MB)
max_concurrent_uploads: usizeMaximum concurrent part uploads
compression_level: i32Compression level for zstd (1-22, default: 3)
sync_interval_secs: u64Sync interval in seconds (how often to check for changes)
Implementations§
Source§impl LayerStorageConfig
impl LayerStorageConfig
Sourcepub fn new(bucket: impl Into<String>) -> Self
pub fn new(bucket: impl Into<String>) -> Self
Create a new config with the required bucket name
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Set the S3 key prefix
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
Set the AWS region
Sourcepub fn with_endpoint_url(self, url: impl Into<String>) -> Self
pub fn with_endpoint_url(self, url: impl Into<String>) -> Self
Set a custom S3 endpoint URL
Sourcepub fn with_staging_dir(self, path: impl Into<PathBuf>) -> Self
pub fn with_staging_dir(self, path: impl Into<PathBuf>) -> Self
Set the staging directory
Sourcepub fn with_state_db_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_state_db_path(self, path: impl Into<PathBuf>) -> Self
Set the state database path
Sourcepub fn object_key(&self, digest: &str) -> String
pub fn object_key(&self, digest: &str) -> String
Build the S3 object key for a given layer digest
Sourcepub fn metadata_key(&self, digest: &str) -> String
pub fn metadata_key(&self, digest: &str) -> String
Build the S3 object key for layer metadata
Trait Implementations§
Source§impl Clone for LayerStorageConfig
impl Clone for LayerStorageConfig
Source§fn clone(&self) -> LayerStorageConfig
fn clone(&self) -> LayerStorageConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayerStorageConfig
impl Debug for LayerStorageConfig
Source§impl Default for LayerStorageConfig
impl Default for LayerStorageConfig
Source§impl<'de> Deserialize<'de> for LayerStorageConfig
impl<'de> Deserialize<'de> for LayerStorageConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for LayerStorageConfig
impl RefUnwindSafe for LayerStorageConfig
impl Send for LayerStorageConfig
impl Sync for LayerStorageConfig
impl Unpin for LayerStorageConfig
impl UnwindSafe for LayerStorageConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more