[][src]Struct holochain_core_types::time::Period

pub struct Period(_);

A human-readable time Period, implemented as a std::time::Duration (which is unsigned). Conversion to/from and Serializable to/from readable form: "1w2d3h4.567s", at full Duration precision; values > 1s w/ ms precision are formatted to fractional seconds w/ full precision, while values < 1s are formatted to integer ms, us or ns as appropriate. Accepts y/yr/year, w/wk/week, d/dy/day, h/hr/hour, m/min/minute, s/sec/second, ms/millis/millisecond, u/μ/micros/microsecond, n/nanos/nanosecond, singular or plural. The humantime and parse_duration crates are complex, incompatible with each other, depend on crates and/or do not compile to WASM.

Trait Implementations

impl Clone for Period[src]

impl Debug for Period[src]

Outputs the human-readable form of the Period's Duration, eg. "1y2w3d4h56m7.89s", "456ms". Debug output of Period specifier instead of underlying Duration seconds.

impl<'d> Deserialize<'d> for Period[src]

impl Display for Period[src]

impl Eq for Period[src]

impl<'_> From<&'_ Duration> for Period[src]

impl<'_> From<&'_ Period> for Duration[src]

impl<'a> From<&'a Period> for JsonString[src]

impl From<Duration> for Period[src]

impl From<Period> for JsonString[src]

impl From<Period> for Timeout[src]

impl From<Period> for Duration[src]

impl FromStr for Period[src]

type Err = HolochainError

The associated error which can be returned from parsing.

impl Hash for Period[src]

impl PartialEq<Period> for Period[src]

impl Serialize for Period[src]

Serialization w/ serde_json to/from String. This means that a timestamp will be deserialized to an Period specification and validated, which may fail, returning a serde::de::Error. Upon serialization, the canonicalized Period specification will be used.

impl StructuralEq for Period[src]

impl StructuralPartialEq for Period[src]

impl<'_> TryFrom<&'_ str> for Period[src]

type Error = HolochainError

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a JsonString> for Period[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl TryFrom<JsonString> for Period[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl TryFrom<String> for Period[src]

type Error = HolochainError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Period

impl Send for Period

impl Sync for Period

impl Unpin for Period

impl UnwindSafe for Period

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,