From 7a918d31bd73a6882d27f94c92ee88d8cfa4a72b Mon Sep 17 00:00:00 2001 From: Luro02 <24826124+Luro02@users.noreply.github.com> Date: Thu, 9 Apr 2020 08:54:56 +0200 Subject: [PATCH] document crate features --- src/lib.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7149cd9..e991a96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,6 +57,40 @@ //! assert!(m3u8.parse::().is_ok()); //! ``` //! +//! ## Crate Feature Flags +//! +//! The following crate feature flags are available: +//! +//! - [`backtrace`] (optional) +//! - Enables the backtrace feature for the `Error` type. +//! - This feature depends on the following dependencies: +//! - [`backtrace`] +//! - [`chrono`] (optional) +//! - Enables parsing dates and verifying them. +//! - This feature depends on the following dependencies: +//! - [`chrono`] +//! - The following things will change: +//! - [`ExtXProgramDateTime::date_time`] will change from [`String`] to +//! `DateTime` +//! - [`ExtXDateRange::start_date`] will change from [`String`] to +//! `DateTime` +//! - [`ExtXDateRange::end_date`] will change from [`String`] to +//! `DateTime` +//! +//! They are configured in your `Cargo.toml` and can be enabled like this +//! +//! ```toml +//! hls_m3u8 = { version = "0.3", features = ["chrono", "backtrace"] } +//! ``` +//! +//! [`ExtXProgramDateTime::date_time`]: +//! crate::tags::ExtXProgramDateTime::date_time +//! [`ExtXDateRange::start_date`]: +//! crate::tags::ExtXDateRange::start_date +//! [`ExtXDateRange::end_date`]: +//! crate::tags::ExtXDateRange::end_date +//! [`chrono`]: https://github.com/chronotope/chrono +//! [`backtrace`]: https://github.com/rust-lang/backtrace-rs //! [HLS]: https://tools.ietf.org/html/rfc8216 pub use error::Error;