Skip to content

Commit

Permalink
Extend documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Jan 31, 2024
1 parent 27fa337 commit 86c5e97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
16 changes: 10 additions & 6 deletions src/naive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ pub use self::time::NaiveTime;
#[doc(hidden)]
pub use self::internals::YearFlags as __BenchYearFlags;

/// Serialization/Deserialization of naive types in alternate formats
/// Serialization/Deserialization of naive types in alternate formats.
///
/// The various modules in here are intended to be used with serde's [`with`
/// annotation][1] to serialize as something other than the default [RFC
/// 3339][2] format.
/// The various modules in here are intended to be used to serialize as something other than the
/// default ISO 8601 format.
///
/// [1]: https://serde.rs/attributes.html#field-attributes
/// [2]: https://tools.ietf.org/html/rfc3339
/// They can be used by combining the module name with serde's [`with` annotation].
/// Alternatively the individual `serialize` and `deserialize` functions in each module can be used
/// with serde's [`serialize_with`] and [`deserialize_with`] annotations.
///
/// [`with` annotation]: https://serde.rs/attributes.html#field-attributes
/// [`serialize_with`]: https://serde.rs/field-attrs.html#serialize_with
/// [`deserialize_with`]: https://serde.rs/field-attrs.html#deserialize_with
#[cfg(feature = "serde")]
pub mod serde {
pub use super::datetime::serde::*;
Expand Down
15 changes: 11 additions & 4 deletions src/serde.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
//! Serialization/Deserialization with serde.
//!
//! This module provides default implementations for `DateTime` using the [RFC 3339][1] format and
//! various alternatives for use with serde's [`with` annotation][2].
//! This module provides default implementations for [`DateTime`] using the [RFC 3339] format and
//! various alternatives.
//!
//! The alternatives are for use with serde's [`with` annotation] combined with the module name.
//! Alternatively the individual `serialize` and `deserialize` functions in each module can be used
//! with serde's [`serialize_with`] and [`deserialize_with`] annotations.
//!
//! *Available on crate feature 'serde' only.*
//!
//! [1]: https://tools.ietf.org/html/rfc3339
//! [2]: https://serde.rs/field-attrs.html#with
//! [`DateTime`]: crate::DateTime
//! [RFC 3339]: https://tools.ietf.org/html/rfc3339
//! [`with` annotation]: https://serde.rs/field-attrs.html#with
//! [`serialize_with`]: https://serde.rs/field-attrs.html#serialize_with
//! [`deserialize_with`]: https://serde.rs/field-attrs.html#deserialize_with
use core::fmt;
use serde::de;

Expand Down

0 comments on commit 86c5e97

Please sign in to comment.