aboutsummaryrefslogtreecommitdiff
path: root/arg_picker/src
diff options
context:
space:
mode:
Diffstat (limited to 'arg_picker/src')
-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
}