pub struct Expirable { /* private fields */ }Expand description
A container for TTL-wrapped values.
Expirable is one of the six container types. It wraps a child node
with expiration metadata, producing { value, expires_at, created_at }.
§Example
ⓘ
use paramdef::container::Expirable;
use paramdef::types::leaf::Text;
let token = Expirable::builder("cached_token")
.label("Cached Token")
.ttl_hours(1)
.auto_refresh(true)
.warning_threshold(300) // Warn 5 min before expiry
.child(Text::builder("token").build())
.build();Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expirable
impl !RefUnwindSafe for Expirable
impl Send for Expirable
impl Sync for Expirable
impl Unpin for Expirable
impl !UnwindSafe for Expirable
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