mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +00:00
docs(serde): fix some copy & paste errors
This commit is contained in:
parent
d90544b764
commit
3105ff5bb9
@ -262,7 +262,7 @@ pub mod ts_nanoseconds {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ser/de to/from timestamps in nanoseconds
|
/// Ser/de to/from optional timestamps in nanoseconds
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`'s `with` attribute.
|
/// Intended for use with `serde`'s `with` attribute.
|
||||||
///
|
///
|
||||||
@ -392,7 +392,7 @@ pub mod ts_nanoseconds_option {
|
|||||||
formatter.write_str("a unix timestamp in nanoseconds or none")
|
formatter.write_str("a unix timestamp in nanoseconds or none")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in nanoseconds since the epoch
|
||||||
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
||||||
where
|
where
|
||||||
D: de::Deserializer<'de>,
|
D: de::Deserializer<'de>,
|
||||||
@ -400,7 +400,7 @@ pub mod ts_nanoseconds_option {
|
|||||||
d.deserialize_i64(NanoSecondsTimestampVisitor).map(Some)
|
d.deserialize_i64(NanoSecondsTimestampVisitor).map(Some)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in nanoseconds since the epoch
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
@ -408,7 +408,7 @@ pub mod ts_nanoseconds_option {
|
|||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in nanoseconds since the epoch
|
||||||
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
@ -696,7 +696,7 @@ pub mod ts_microseconds_option {
|
|||||||
formatter.write_str("a unix timestamp in microseconds or none")
|
formatter.write_str("a unix timestamp in microseconds or none")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in microseconds since the epoch
|
||||||
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
||||||
where
|
where
|
||||||
D: de::Deserializer<'de>,
|
D: de::Deserializer<'de>,
|
||||||
@ -704,7 +704,7 @@ pub mod ts_microseconds_option {
|
|||||||
d.deserialize_i64(MicroSecondsTimestampVisitor).map(Some)
|
d.deserialize_i64(MicroSecondsTimestampVisitor).map(Some)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in microseconds since the epoch
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
@ -712,7 +712,7 @@ pub mod ts_microseconds_option {
|
|||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in microseconds since the epoch
|
||||||
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
@ -1010,7 +1010,7 @@ pub mod ts_milliseconds_option {
|
|||||||
formatter.write_str("a unix timestamp in milliseconds or none")
|
formatter.write_str("a unix timestamp in milliseconds or none")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in milliseconds since the epoch
|
||||||
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
fn visit_some<D>(self, d: D) -> Result<Self::Value, D::Error>
|
||||||
where
|
where
|
||||||
D: de::Deserializer<'de>,
|
D: de::Deserializer<'de>,
|
||||||
@ -1018,7 +1018,7 @@ pub mod ts_milliseconds_option {
|
|||||||
d.deserialize_i64(MilliSecondsTimestampVisitor).map(Some)
|
d.deserialize_i64(MilliSecondsTimestampVisitor).map(Some)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in milliseconds since the epoch
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
@ -1026,7 +1026,7 @@ pub mod ts_milliseconds_option {
|
|||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a timestamp in seconds since the epoch
|
/// Deserialize a timestamp in milliseconds since the epoch
|
||||||
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
fn visit_unit<E>(self) -> Result<Self::Value, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
|
@ -95,7 +95,7 @@ pub mod ts_nanoseconds {
|
|||||||
use super::ne_timestamp;
|
use super::ne_timestamp;
|
||||||
use crate::NaiveDateTime;
|
use crate::NaiveDateTime;
|
||||||
|
|
||||||
/// Serialize a UTC datetime into an integer number of nanoseconds since the epoch
|
/// Serialize a datetime into an integer number of nanoseconds since the epoch
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `serialize_with` attribute.
|
/// Intended for use with `serde`s `serialize_with` attribute.
|
||||||
///
|
///
|
||||||
@ -136,7 +136,7 @@ pub mod ts_nanoseconds {
|
|||||||
serializer.serialize_i64(dt.timestamp_nanos())
|
serializer.serialize_i64(dt.timestamp_nanos())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a `DateTime` from a nanoseconds timestamp
|
/// Deserialize a `NaiveDateTime` from a nanoseconds timestamp
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `deserialize_with` attribute.
|
/// Intended for use with `serde`s `deserialize_with` attribute.
|
||||||
///
|
///
|
||||||
@ -245,7 +245,7 @@ pub mod ts_milliseconds {
|
|||||||
use super::ne_timestamp;
|
use super::ne_timestamp;
|
||||||
use crate::NaiveDateTime;
|
use crate::NaiveDateTime;
|
||||||
|
|
||||||
/// Serialize a UTC datetime into an integer number of milliseconds since the epoch
|
/// Serialize a datetime into an integer number of milliseconds since the epoch
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `serialize_with` attribute.
|
/// Intended for use with `serde`s `serialize_with` attribute.
|
||||||
///
|
///
|
||||||
@ -286,7 +286,7 @@ pub mod ts_milliseconds {
|
|||||||
serializer.serialize_i64(dt.timestamp_millis())
|
serializer.serialize_i64(dt.timestamp_millis())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a `DateTime` from a milliseconds timestamp
|
/// Deserialize a `NaiveDateTime` from a milliseconds timestamp
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `deserialize_with` attribute.
|
/// Intended for use with `serde`s `deserialize_with` attribute.
|
||||||
///
|
///
|
||||||
@ -395,7 +395,7 @@ pub mod ts_seconds {
|
|||||||
use super::ne_timestamp;
|
use super::ne_timestamp;
|
||||||
use crate::NaiveDateTime;
|
use crate::NaiveDateTime;
|
||||||
|
|
||||||
/// Serialize a UTC datetime into an integer number of seconds since the epoch
|
/// Serialize a datetime into an integer number of seconds since the epoch
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `serialize_with` attribute.
|
/// Intended for use with `serde`s `serialize_with` attribute.
|
||||||
///
|
///
|
||||||
@ -436,7 +436,7 @@ pub mod ts_seconds {
|
|||||||
serializer.serialize_i64(dt.timestamp())
|
serializer.serialize_i64(dt.timestamp())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deserialize a `DateTime` from a seconds timestamp
|
/// Deserialize a `NaiveDateTime` from a seconds timestamp
|
||||||
///
|
///
|
||||||
/// Intended for use with `serde`s `deserialize_with` attribute.
|
/// Intended for use with `serde`s `deserialize_with` attribute.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user