pub struct AssetConfig {
pub cache_dir: Option<String>,
pub max_cache_size: Option<String>,
pub max_file_age: Option<String>,
pub eviction_policy: Option<EvictionPolicy>,
}Expand description
Raw configuration as loaded from devboy.toml.
Use AssetConfig::resolve to produce a validated ResolvedAssetConfig
with absolute paths and parsed sizes / durations.
Fields§
§cache_dir: Option<String>Custom cache directory. If unset, falls back to
dirs::cache_dir()/devboy-tools/assets.
max_cache_size: Option<String>Maximum cache size in human-readable form, e.g. "1Gi".
max_file_age: Option<String>Maximum age for an unaccessed file before it becomes eligible for
eviction, e.g. "7d".
eviction_policy: Option<EvictionPolicy>Implementations§
Source§impl AssetConfig
impl AssetConfig
Sourcepub fn resolve(&self) -> Result<ResolvedAssetConfig>
pub fn resolve(&self) -> Result<ResolvedAssetConfig>
Parse and validate the configuration, applying defaults where needed.
Trait Implementations§
Source§impl Clone for AssetConfig
impl Clone for AssetConfig
Source§fn clone(&self) -> AssetConfig
fn clone(&self) -> AssetConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssetConfig
impl Debug for AssetConfig
Source§impl Default for AssetConfig
impl Default for AssetConfig
Source§fn default() -> AssetConfig
fn default() -> AssetConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AssetConfig
impl<'de> Deserialize<'de> for AssetConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AssetConfig
impl PartialEq for AssetConfig
Source§fn eq(&self, other: &AssetConfig) -> bool
fn eq(&self, other: &AssetConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AssetConfig
impl Serialize for AssetConfig
impl StructuralPartialEq for AssetConfig
Auto Trait Implementations§
impl Freeze for AssetConfig
impl RefUnwindSafe for AssetConfig
impl Send for AssetConfig
impl Sync for AssetConfig
impl Unpin for AssetConfig
impl UnsafeUnpin for AssetConfig
impl UnwindSafe for AssetConfig
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