Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ figment = { version = "0.10.0", features = [
"test",
"yaml",
], optional = true }
nonempty = { version = "0.10.0", features = ["serialize"], optional = true }
paste = { version = "1.0.0", optional = true }
reqwest = { version = "0.13.0", optional = true }
schemars = { version = "1.2.0", optional = true }
Expand All @@ -44,6 +45,7 @@ time = ["dep:time"]
schemars = ["dep:schemars", "schemars/url2"]
serde = ["dep:serde", "dep:paste"]
base_url = ["dep:url", "dep:thiserror", "dep:serde"]
non_empty = ["dep:nonempty", "dep:serde", "dep:thiserror"]

[lints.rust]
dead_code = "warn"
Expand Down
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: Apache-2.0

#![cfg_attr(all(doc, not(doctest)), feature(doc_auto_cfg))]
//! This crate consists of incohesive generic types and functions that are
//! needed in almost every crate but are so small that making a separate crate
//! for them is too much.
Expand All @@ -16,6 +15,9 @@
//! See [`LevelFilter`], [`BaseUrl`] and [`duration`] for useful wrapper types
//! to use in your `serde`-based configs.
//!
//! See [`NonEmptyString`], [`TrimmedNonEmptyString`], and [`NonEmptyVec`] for
//! non-empty types that enforce invariants at deserialization time.
//!
//! Enable `schemars` feature to get [`schemars::JsonSchema`] impls for
//! "config-helper" types to generate config schemas (for documentation and
//! validation purposes).
Expand All @@ -35,13 +37,19 @@ pub mod config;
pub mod duration;
#[cfg(feature = "level_filter")]
mod level_filter;
#[cfg(feature = "non_empty")]
pub mod non_empty;
#[cfg(feature = "reqwest")]
pub mod reqwest;

#[cfg(feature = "base_url")]
pub use base_url::{BaseUrl, BaseUrlParseError};
#[cfg(feature = "level_filter")]
pub use level_filter::LevelFilter;
#[cfg(feature = "non_empty")]
pub use non_empty::{
nonempty, NonEmpty, NonEmptyError, NonEmptyString, NonEmptyVec, TrimmedNonEmptyString,
};

/// Generic combinators on polymorphic unconstrained types that `std` lacks.
///
Expand Down
Loading