pub enum DatabaseTimeToLive {
Forever,
Duration(Duration),
}
Expand description
Time To Live for database, which can be Forever
, or a Duration
, but can’t be Instant
.
unlike TimeToLive
which can be Instant
, Forever
, or a Duration
Variants§
Forever
Keep the data forever
Duration(Duration)
Duration to keep the data, this duration should be non-zero
Implementations§
source§impl DatabaseTimeToLive
impl DatabaseTimeToLive
sourcepub fn from_humantime_or_str(s: &str) -> Result<Self, Error>
pub fn from_humantime_or_str(s: &str) -> Result<Self, Error>
Parse a string that is either forever
, or a duration to TimeToLive
note that an empty string or a zero duration(a duration that spans no time) is treat as forever
too
Trait Implementations§
source§impl Clone for DatabaseTimeToLive
impl Clone for DatabaseTimeToLive
source§fn clone(&self) -> DatabaseTimeToLive
fn clone(&self) -> DatabaseTimeToLive
Returns a copy 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 DatabaseTimeToLive
impl Debug for DatabaseTimeToLive
source§impl Default for DatabaseTimeToLive
impl Default for DatabaseTimeToLive
source§fn default() -> DatabaseTimeToLive
fn default() -> DatabaseTimeToLive
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for DatabaseTimeToLive
impl<'de> Deserialize<'de> for DatabaseTimeToLive
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 Display for DatabaseTimeToLive
impl Display for DatabaseTimeToLive
source§impl From<DatabaseTimeToLive> for TimeToLive
impl From<DatabaseTimeToLive> for TimeToLive
source§fn from(value: DatabaseTimeToLive) -> Self
fn from(value: DatabaseTimeToLive) -> Self
Converts to this type from the input type.
source§impl From<Duration> for DatabaseTimeToLive
impl From<Duration> for DatabaseTimeToLive
source§impl From<Duration> for DatabaseTimeToLive
impl From<Duration> for DatabaseTimeToLive
source§impl Ord for DatabaseTimeToLive
impl Ord for DatabaseTimeToLive
source§fn cmp(&self, other: &DatabaseTimeToLive) -> Ordering
fn cmp(&self, other: &DatabaseTimeToLive) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for DatabaseTimeToLive
impl PartialEq for DatabaseTimeToLive
source§impl PartialOrd for DatabaseTimeToLive
impl PartialOrd for DatabaseTimeToLive
source§impl Serialize for DatabaseTimeToLive
impl Serialize for DatabaseTimeToLive
source§impl TryFrom<TimeToLive> for DatabaseTimeToLive
impl TryFrom<TimeToLive> for DatabaseTimeToLive
impl Copy for DatabaseTimeToLive
impl Eq for DatabaseTimeToLive
impl StructuralPartialEq for DatabaseTimeToLive
Auto Trait Implementations§
impl Freeze for DatabaseTimeToLive
impl RefUnwindSafe for DatabaseTimeToLive
impl Send for DatabaseTimeToLive
impl Sync for DatabaseTimeToLive
impl Unpin for DatabaseTimeToLive
impl UnwindSafe for DatabaseTimeToLive
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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<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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request