From e1bd0086f19d6da0c1b9980e65c2fd0dc965abfc Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 22 Apr 2019 13:33:29 +0200 Subject: [PATCH] time, date: Add missing docs. --- src/date.rs | 3 +++ src/time.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/date.rs b/src/date.rs index f50a1c4..73dd3bd 100644 --- a/src/date.rs +++ b/src/date.rs @@ -16,14 +16,17 @@ use std::str::FromStr; pub struct DateTime(ChronoDateTime); impl DateTime { + /// Retrieves the associated timezone. pub fn timezone(&self) -> FixedOffset { self.0.timezone() } + /// Returns a new `DateTime` with a different timezone. pub fn with_timezone(&self, tz: &FixedOffset) -> DateTime { DateTime(self.0.with_timezone(tz)) } + /// Formats this `DateTime` with the specified format string. pub fn format(&self, fmt: &str) -> String { format!("{}", self.0.format(fmt)) } diff --git a/src/time.rs b/src/time.rs index c107393..9186666 100644 --- a/src/time.rs +++ b/src/time.rs @@ -14,11 +14,13 @@ use std::convert::TryFrom; use std::str::FromStr; generate_empty_element!( + /// An entity time query. TimeQuery, "time", TIME ); impl IqGetPayload for TimeQuery {} +/// An entity time result, containing an unique DateTime. #[derive(Debug, Clone)] pub struct TimeResult(pub DateTime);