pub struct CacheTtl(/* private fields */);Expand description
A nonnegative final cache TTL that retains its exact JSON-integer spelling.
Implementations§
Source§impl CacheTtl
impl CacheTtl
Sourcepub fn milliseconds(value: u64) -> Self
pub fn milliseconds(value: u64) -> Self
Creates a nonnegative TTL in milliseconds.
Sourcepub fn try_as_millis(&self) -> Result<u64, CacheTtlConversionError>
pub fn try_as_millis(&self) -> Result<u64, CacheTtlConversionError>
Converts this wire value into the bounded local millisecond domain.
This is intentionally checked: the final schema has no maximum, while
local duration APIs accept at most u64 milliseconds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CacheTtl
impl<'de> Deserialize<'de> for CacheTtl
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
impl Eq for CacheTtl
impl StructuralPartialEq for CacheTtl
Source§impl TryFrom<JsonInteger> for CacheTtl
impl TryFrom<JsonInteger> for CacheTtl
Source§type Error = CacheTtlConversionError
type Error = CacheTtlConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for CacheTtl
impl RefUnwindSafe for CacheTtl
impl Send for CacheTtl
impl Sync for CacheTtl
impl Unpin for CacheTtl
impl UnsafeUnpin for CacheTtl
impl UnwindSafe for CacheTtl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).