pub enum OneOfDurationOrIso8601Expression {
Duration(Duration),
Iso8601Expression(String),
}Expand description
Represents a value that can be either a Duration or an ISO 8601 duration expression
Variants§
Duration(Duration)
Variant holding a duration
Iso8601Expression(String)
Variant holding an ISO 8601 duration expression
Implementations§
Source§impl OneOfDurationOrIso8601Expression
impl OneOfDurationOrIso8601Expression
Sourcepub fn total_milliseconds(&self) -> u64
pub fn total_milliseconds(&self) -> u64
Gets the total milliseconds for inline Duration variant. Returns 0 for ISO8601 expression variant (needs runtime parsing).
Sourcepub fn is_duration(&self) -> bool
pub fn is_duration(&self) -> bool
Returns true if this is an inline Duration variant
Sourcepub fn is_iso8601(&self) -> bool
pub fn is_iso8601(&self) -> bool
Returns true if this is an ISO8601 expression variant
Sourcepub fn as_iso8601(&self) -> Option<&str>
pub fn as_iso8601(&self) -> Option<&str>
Gets the ISO8601 expression string, if this is an expression variant
Trait Implementations§
Source§impl Clone for OneOfDurationOrIso8601Expression
impl Clone for OneOfDurationOrIso8601Expression
Source§fn clone(&self) -> OneOfDurationOrIso8601Expression
fn clone(&self) -> OneOfDurationOrIso8601Expression
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<'de> Deserialize<'de> for OneOfDurationOrIso8601Expression
impl<'de> Deserialize<'de> for OneOfDurationOrIso8601Expression
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 OneOfDurationOrIso8601Expression
impl PartialEq for OneOfDurationOrIso8601Expression
Source§fn eq(&self, other: &OneOfDurationOrIso8601Expression) -> bool
fn eq(&self, other: &OneOfDurationOrIso8601Expression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for OneOfDurationOrIso8601Expression
impl StructuralPartialEq for OneOfDurationOrIso8601Expression
Auto Trait Implementations§
impl Freeze for OneOfDurationOrIso8601Expression
impl RefUnwindSafe for OneOfDurationOrIso8601Expression
impl Send for OneOfDurationOrIso8601Expression
impl Sync for OneOfDurationOrIso8601Expression
impl Unpin for OneOfDurationOrIso8601Expression
impl UnsafeUnpin for OneOfDurationOrIso8601Expression
impl UnwindSafe for OneOfDurationOrIso8601Expression
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