pub struct Duration(/* private fields */);Expand description
An ISO 8601 formatted duration
Implementations§
Source§impl Duration
impl Duration
Sourcepub const P999Y: Self
pub const P999Y: Self
Indicates that an event’s intervals continue indefinitely into the future until the event is deleted or modified. This effectively represents an infinite duration.
pub const PT0S: Self
Sourcepub fn to_chrono_at_datetime<Tz: TimeZone>(&self, at: DateTime<Tz>) -> Duration
pub fn to_chrono_at_datetime<Tz: TimeZone>(&self, at: DateTime<Tz>) -> Duration
Because iso8601 durations can include months and years, they don’t independently have a fixed duration. Their real duration (in real units like seconds) can only be determined when a starting time is given.
NOTE: does not consider leap seconds!
pub const fn hours(hour: f32) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Duration
impl<'de> Deserialize<'de> for Duration
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 StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP