add doc for ValidArgs

This commit is contained in:
gengteng
2023-09-26 18:46:00 +08:00
parent f4a2d2c2de
commit 323d16c142

View File

@@ -73,7 +73,17 @@ impl<E> Valid<E> {
} }
} }
/// `ValidArgs` can be used with extractors from the various modules.
/// Refer to the examples for `Valid` in each module - the usage of
/// `ValidArgs` is similar, except the inner data type implements
/// `ValidateArgs` instead of `Validate`.
/// ///
/// `ValidateArgs` is usually automatically implemented by validator's
/// derive macros. Refer to validator's documentation for details.
///
/// Note that the documentation for each module currently only shows
/// examples of `Valid`, and does not demonstrate concrete usage of
/// `ValidArgs`, but the usage is analogous.
#[derive(Debug, Clone, Copy, Default)] #[derive(Debug, Clone, Copy, Default)]
pub struct ValidArgs<E>(pub E); pub struct ValidArgs<E>(pub E);