Skip to content

Commit cce83db

Browse files
committed
docs(gctx): expand module level docs for config schemas
1 parent 2059e0f commit cce83db

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/cargo/util/context/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
//! - [`StringList`]: Get a value that is either a list or a whitespace split
2121
//! string.
2222
//!
23+
//! # Config schemas
24+
//!
25+
//! Configuration schemas are defined in the [`schema`] module.
26+
//!
2327
//! ## Config deserialization
2428
//!
2529
//! Cargo uses a two-layer deserialization approach:

src/cargo/util/context/schema.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
//! Cargo configuration schemas.
2+
//!
3+
//! This module contains types that define the schema for various configuration
4+
//! sections found in Cargo configuration.
5+
//!
6+
//! These types are mostly used by [`GlobalContext::get`](super::GlobalContext::get)
7+
//! to deserialize configuration values from TOML files, environment variables,
8+
//! and CLI arguments.
9+
//!
10+
//! Schema types here should only contain data and simple accessor methods.
11+
//! Avoid depending on [`GlobalContext`](super::GlobalContext) directly.
12+
113
use std::borrow::Cow;
214
use std::collections::HashMap;
315
use std::ffi::OsStr;

0 commit comments

Comments
 (0)