aboutsummaryrefslogtreecommitdiff
path: root/arg_picker
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-20 14:49:47 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-20 14:49:47 +0800
commit9f5a0f2e9325264564bc6fe9ff544c034ad16287 (patch)
tree417cfb041e0713b407b0020fbacea6dc635565b5 /arg_picker
parentde3156d0b054fc6e459e526d92df4d06ce6e6770 (diff)
chore: add missing docs lint and document public API
Add `#![deny(missing_docs)]` across multiple crates and fill in documentation for all public items, including struct fields, enum variants, trait methods, and proc macros. Also mark two shell scripts as executable.
Diffstat (limited to 'arg_picker')
-rw-r--r--arg_picker/src/lib.rs1
-rw-r--r--arg_picker/src/pickable/multi_pickable.rs16
-rw-r--r--arg_picker/src/value/vec_until.rs1
3 files changed, 18 insertions, 0 deletions
diff --git a/arg_picker/src/lib.rs b/arg_picker/src/lib.rs
index 285cd16..d292826 100644
--- a/arg_picker/src/lib.rs
+++ b/arg_picker/src/lib.rs
@@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
+#![deny(missing_docs)]
mod builtin;
diff --git a/arg_picker/src/pickable/multi_pickable.rs b/arg_picker/src/pickable/multi_pickable.rs
index 84a8068..404c23b 100644
--- a/arg_picker/src/pickable/multi_pickable.rs
+++ b/arg_picker/src/pickable/multi_pickable.rs
@@ -5,13 +5,29 @@ use crate::{
};
/// Boundary check for multi-value positional parameters.
+///
+/// Determines whether a raw string marks the end of a multi-value
+/// parameter's input range.
pub trait BoundaryCheck {
+ /// Returns `true` if `raw` indicates a boundary (i.e., the start of
+ /// a new parameter), stopping greedy collection.
fn check_boundary(raw: &str) -> bool;
}
/// Trait for multi-value parameters.
+///
+/// Implementors define how a sequence of raw strings is converted into
+/// a single value, with an associated [`BoundaryCheck`] to control where
+/// collection stops.
pub trait MultiPickableWithBoundary: Sized {
+ /// The boundary checker type that determines when to stop consuming
+ /// positional arguments.
type Checker: BoundaryCheck;
+
+ /// Parse and collect multiple raw string values into `Self`.
+ ///
+ /// The caller should stop passing additional items once the
+ /// associated [`Checker`](Self::Checker) signals a boundary.
fn pick_multi(raw: Vec<String>) -> PickerArgResult<Self>;
}
diff --git a/arg_picker/src/value/vec_until.rs b/arg_picker/src/value/vec_until.rs
index 1b79641..04d87ce 100644
--- a/arg_picker/src/value/vec_until.rs
+++ b/arg_picker/src/value/vec_until.rs
@@ -21,6 +21,7 @@ pub struct VecUntil<T> {
}
impl<T> VecUntil<T> {
+ /// Consumes `self` and returns the underlying [`Vec<T>`].
pub fn into_inner(self) -> Vec<T> {
self.inner
}