time, date: Add missing docs.

Emmanuel Gil Peyrot created

Change summary

src/date.rs | 3 +++
src/time.rs | 2 ++
2 files changed, 5 insertions(+)

Detailed changes

src/date.rs 🔗

@@ -16,14 +16,17 @@ use std::str::FromStr;
 pub struct DateTime(ChronoDateTime<FixedOffset>);
 
 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))
     }

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);