[−][src]Struct hdk::prelude::Iso8601
This struct represents datetime data recovered from a string in the ISO 8601 and RFC 3339 (more
restrictive) format. Invalid try_from conversions fails w/ Result<DateTime
Iso8601 wraps a DateTime
Display: 2018-10-11T03:23:38+00:00 Debug: Iso8601(2018-10-11T03:23:38+00:00)
More info on the relevant wikipedia article.
Implementations
impl Iso8601
[src]
Infallible conversions into and from an Iso8601. The only infallible ways to create an Iso8601
is from
a Unix timestamp, or new
with a timestamp and nanoseconds, or by converting to/from
its underlying DateTime
Trait Implementations
impl<D> Add<D> for Iso8601 where
D: Into<Duration>,
[src]
D: Into<Duration>,
Iso8601 +- Into
type Output = Result<Iso8601, HolochainError>
The resulting type after applying the +
operator.
fn add(self, rhs: D) -> <Iso8601 as Add<D>>::Output
[src]
impl<'_, D> Add<D> for &'_ Iso8601 where
D: Into<Duration>,
[src]
D: Into<Duration>,
type Output = Result<Iso8601, HolochainError>
The resulting type after applying the +
operator.
fn add(self, rhs: D) -> <&'_ Iso8601 as Add<D>>::Output
[src]
impl Clone for Iso8601
[src]
impl Copy for Iso8601
[src]
impl Debug for Iso8601
[src]
impl<'d> Deserialize<'d> for Iso8601
[src]
fn deserialize<D>(
deserializer: D
) -> Result<Iso8601, <D as Deserializer<'d>>::Error> where
D: Deserializer<'d>,
[src]
deserializer: D
) -> Result<Iso8601, <D as Deserializer<'d>>::Error> where
D: Deserializer<'d>,
impl Display for Iso8601
[src]
Outputs the canonicalized ISO 8601 / RFC 3339 form for a valid timestamp.
impl Eq for Iso8601
[src]
impl<'_> From<&'_ DateTime<FixedOffset>> for Iso8601
[src]
fn from(lhs: &DateTime<FixedOffset>) -> Iso8601
[src]
impl<'a> From<&'a Iso8601> for JsonString
[src]
fn from(v: &Iso8601) -> JsonString
[src]
impl From<DateTime<FixedOffset>> for Iso8601
[src]
fn from(lhs: DateTime<FixedOffset>) -> Iso8601
[src]
impl From<Iso8601> for JsonString
[src]
fn from(v: Iso8601) -> JsonString
[src]
impl From<i32> for Iso8601
[src]
impl From<i64> for Iso8601
[src]
impl From<u32> for Iso8601
[src]
impl From<u64> for Iso8601
[src]
impl FromStr for Iso8601
[src]
type Err = HolochainError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Iso8601, <Iso8601 as FromStr>::Err>
[src]
impl Hash for Iso8601
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Iso8601
[src]
fn cmp(&self, other: &Iso8601) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Iso8601> for Iso8601
[src]
impl PartialOrd<Iso8601> for Iso8601
[src]
fn partial_cmp(&self, other: &Iso8601) -> Option<Ordering>
[src]
fn lt(&self, other: &Iso8601) -> bool
[src]
fn le(&self, other: &Iso8601) -> bool
[src]
fn gt(&self, other: &Iso8601) -> bool
[src]
fn ge(&self, other: &Iso8601) -> bool
[src]
impl Serialize for Iso8601
[src]
Serialization w/ serde_json to/from String. This means that a timestamp will be deserialized to an Iso8601 and validated, which may fail, returning a serde::de::Error. Upon serialization, the canonicalized ISO 8601 / RFC 3339 version of the timestamp will be used.
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralEq for Iso8601
[src]
impl StructuralPartialEq for Iso8601
[src]
impl<D> Sub<D> for Iso8601 where
D: Into<Duration>,
[src]
D: Into<Duration>,
type Output = Result<Iso8601, HolochainError>
The resulting type after applying the -
operator.
fn sub(self, rhs: D) -> <Iso8601 as Sub<D>>::Output
[src]
impl<'_, D> Sub<D> for &'_ Iso8601 where
D: Into<Duration>,
[src]
D: Into<Duration>,
type Output = Result<Iso8601, HolochainError>
The resulting type after applying the -
operator.
fn sub(self, rhs: D) -> <&'_ Iso8601 as Sub<D>>::Output
[src]
impl<'_> TryFrom<&'_ str> for Iso8601
[src]
type Error = HolochainError
The type returned in the event of a conversion error.
fn try_from(s: &str) -> Result<Iso8601, <Iso8601 as TryFrom<&'_ str>>::Error>
[src]
impl<'a> TryFrom<&'a JsonString> for Iso8601
[src]
type Error = JsonError
The type returned in the event of a conversion error.
fn try_from(
json_string: &JsonString
) -> Result<Iso8601, <Iso8601 as TryFrom<&'a JsonString>>::Error>
[src]
json_string: &JsonString
) -> Result<Iso8601, <Iso8601 as TryFrom<&'a JsonString>>::Error>
impl TryFrom<JsonString> for Iso8601
[src]
type Error = JsonError
The type returned in the event of a conversion error.
fn try_from(
json_string: JsonString
) -> Result<Iso8601, <Iso8601 as TryFrom<JsonString>>::Error>
[src]
json_string: JsonString
) -> Result<Iso8601, <Iso8601 as TryFrom<JsonString>>::Error>
impl TryFrom<String> for Iso8601
[src]
Conversions try_from on String/&str on an Iso8601 are fallible conversions, which may produce a HolochainError if the timestamp is not valid ISO 8601 / RFC 3339. We will allow some flexibilty; strip surrounding whitespace, a bare timestamp missing any timezone specifier will be assumed to be UTC "Zulu", make internal separators optional if unambiguous. If you keep to straight RFC 3339 timestamps, then parsing will be quick, otherwise we'll employ a regular expression to parse a more flexible subset of the ISO 8601 standard from your supplied timestamp, and then use the RFC 3339 parser again. We only do this validation once; at the creation of an Iso8601 from a String/&str. There are some years that can be encoded as a DateTime but not parsed, such as negative (BC/BCE) years.
Auto Trait Implementations
impl RefUnwindSafe for Iso8601
impl Send for Iso8601
impl Sync for Iso8601
impl Unpin for Iso8601
impl UnwindSafe for Iso8601
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Clone for T where
T: Clone,
[src]
T: Clone,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,