Skip to content

Commit

Permalink
Export Archived* types in rkyv module
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Sep 21, 2023
1 parent bc9d070 commit 5fc9be8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
20 changes: 20 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,26 @@ pub mod serde {
pub use super::datetime::serde::*;
}

/// Zero-copy serialization/deserialization with rkyv.
///
/// This module re-exports the `Archived*` versions of chrono's types.
#[cfg(feature = "rkyv")]
#[cfg_attr(docsrs, doc(cfg(feature = "rkyv")))]
pub mod rkyv {
pub use crate::datetime::ArchivedDateTime;
pub use crate::duration::ArchivedDuration;
pub use crate::month::ArchivedMonth;
pub use crate::naive::date::ArchivedNaiveDate;
pub use crate::naive::datetime::ArchivedNaiveDateTime;
pub use crate::naive::isoweek::ArchivedIsoWeek;
pub use crate::naive::time::ArchivedNaiveTime;
pub use crate::offset::fixed::ArchivedFixedOffset;
#[cfg(feature = "clock")]
pub use crate::offset::local::ArchivedLocal;
pub use crate::offset::utc::ArchivedUtc;
pub use crate::weekday::ArchivedWeekday;
}

/// Out of range error type used in various converting APIs
#[derive(Clone, Copy, Hash, PartialEq, Eq)]
pub struct OutOfRange {
Expand Down
6 changes: 3 additions & 3 deletions src/naive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
//! (e.g. [`TimeZone`](../offset/trait.TimeZone.html)),
//! but can be also used for the simpler date and time handling.
mod date;
pub(crate) mod date;
pub(crate) mod datetime;
mod internals;
mod isoweek;
mod time;
pub(crate) mod isoweek;
pub(crate) mod time;

pub use self::date::{Days, NaiveDate, NaiveDateDaysIterator, NaiveDateWeeksIterator, NaiveWeek};
#[allow(deprecated)]
Expand Down
6 changes: 3 additions & 3 deletions src/offset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ use crate::Weekday;
#[allow(deprecated)]
use crate::{Date, DateTime};

mod fixed;
pub(crate) mod fixed;
pub use self::fixed::FixedOffset;

#[cfg(feature = "clock")]
mod local;
pub(crate) mod local;
#[cfg(feature = "clock")]
pub use self::local::Local;

mod utc;
pub(crate) mod utc;
pub use self::utc::Utc;

/// The conversion result from the local time to the timezone-aware datetime types.
Expand Down

0 comments on commit 5fc9be8

Please sign in to comment.