mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-02 01:26:28 +01:00
Minor documentation improvements
This commit is contained in:
@@ -6,7 +6,8 @@ use crate::{Error, Partial, error::ErrorInner};
|
||||
/// A file as source for configuration.
|
||||
///
|
||||
/// By default, the file is considered optional, meaning that on [`File::load`],
|
||||
/// if the file does not exist, `Partial::empty()` is returned.
|
||||
/// if the file does not exist, [`Partial::empty()`][crate::Partial::empty] is
|
||||
/// returned.
|
||||
pub struct File {
|
||||
path: PathBuf,
|
||||
format: FileFormat,
|
||||
|
||||
@@ -108,7 +108,8 @@ pub use self::{
|
||||
///
|
||||
/// - **`Option<T>`**: this marks the field as an optional field. All other
|
||||
/// fields are non-optional and will raise an error if while loading the
|
||||
/// configuration, no value has been set for them.
|
||||
/// configuration, no value has been set for them. Optional fields cannot have
|
||||
/// a `#[config(default = ...)]` attribute as that would not make sense.
|
||||
///
|
||||
///
|
||||
///
|
||||
|
||||
@@ -7,6 +7,7 @@ use core::fmt;
|
||||
// fine, but before reaching 1.0 I need to figure out how to allow future
|
||||
// additions without breaking stuff.
|
||||
|
||||
/// Root type.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Meta {
|
||||
/// The type (struct) name.
|
||||
@@ -38,9 +39,11 @@ pub enum FieldKind {
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum LeafKind {
|
||||
/// A leaf field with a non `Option<_>` type.
|
||||
Required {
|
||||
default: Option<Expr>,
|
||||
},
|
||||
/// A leaf field with an `Option<_>` type.
|
||||
Optional,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//! YAML specific features. This module only exists if the Cargo feature `yaml`
|
||||
//! is enabled.
|
||||
|
||||
use std::fmt::{self, Write};
|
||||
|
||||
use crate::{
|
||||
|
||||
Reference in New Issue
Block a user