pub struct ImageCacheSettings {
pub disk_cache_max_mb: u32,
pub disk_cache_max_age_hours: u32,
}Expand description
图片磁盘缓存配置(uploads/.cache/ 的容量与保留策略)。
Fields§
§disk_cache_max_mb: u32最大总容量(MB),超限按修改时间删最旧文件。
disk_cache_max_age_hours: u32文件最大保留时长(小时),超期优先删除。
Implementations§
Source§impl ImageCacheSettings
impl ImageCacheSettings
Sourcepub fn clamp_max_mb(n: u32) -> u32
pub fn clamp_max_mb(n: u32) -> u32
将容量上限钳制到合法范围 [MIN, ∞)。
Sourcepub fn clamp_max_age_hours(n: u32) -> u32
pub fn clamp_max_age_hours(n: u32) -> u32
将保留时长钳制到合法范围 [MIN, ∞)。
Trait Implementations§
Source§impl Clone for ImageCacheSettings
impl Clone for ImageCacheSettings
Source§fn clone(&self) -> ImageCacheSettings
fn clone(&self) -> ImageCacheSettings
Returns a duplicate of the value. Read more
1.0.0 · 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 ImageCacheSettings
impl Debug for ImageCacheSettings
Source§impl Default for ImageCacheSettings
impl Default for ImageCacheSettings
Source§impl<'de> Deserialize<'de> for ImageCacheSettings
impl<'de> Deserialize<'de> for ImageCacheSettings
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 ImageCacheSettings
impl PartialEq for ImageCacheSettings
Source§impl Serialize for ImageCacheSettings
impl Serialize for ImageCacheSettings
impl StructuralPartialEq for ImageCacheSettings
Auto Trait Implementations§
impl Freeze for ImageCacheSettings
impl RefUnwindSafe for ImageCacheSettings
impl Send for ImageCacheSettings
impl Sync for ImageCacheSettings
impl Unpin for ImageCacheSettings
impl UnsafeUnpin for ImageCacheSettings
impl UnwindSafe for ImageCacheSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
§impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
impl<T> Transportable for Twhere
T: Serialize + DeserializeOwned + 'static,
§fn transport_to_bytes(&self) -> Vec<u8> ⓘ
fn transport_to_bytes(&self) -> Vec<u8> ⓘ
Serialize the type to a byte vector for transport
§fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
fn transport_from_bytes(bytes: &[u8]) -> Result<T, Error<Error>>
Deserialize the type from a byte slice