pub struct PosSpec<'a, Ctx: ?Sized> { /* private fields */ }Expand description
Positional argument specification.
Implementations§
Source§impl<'a, Ctx: ?Sized> PosSpec<'a, Ctx>
impl<'a, Ctx: ?Sized> PosSpec<'a, Ctx>
pub fn new<F>(name: &'a str, cb: F) -> Self
pub fn new_try<F, E>(name: &'a str, cb: F) -> Self
pub fn help(self, h: &'a str) -> Self
pub fn required(self) -> Self
pub fn many(self) -> Self
pub fn range(self, min: usize, max: usize) -> Self
Sourcepub fn validator<F, E>(self, v: F) -> Self
pub fn validator<F, E>(self, v: F) -> Self
Positional validator that returns a displayable error (converted into Error::User).
Sourcepub fn validator_try<F, E>(self, v: F) -> Self
pub fn validator_try<F, E>(self, v: F) -> Self
Positional validator that returns a typed error (boxed into Error::UserAny).
pub fn get_name(&self) -> &str
pub fn get_help(&self) -> Option<&str>
pub fn get_cardinality(&self) -> PosCardinality
pub fn is_required(&self) -> bool
pub fn is_multiple(&self) -> bool
pub fn get_on_value(&self) -> &OnValueFn<'a, Ctx>
pub fn get_validator(&self) -> Option<&ValueValidatorFn<'a>>
Auto Trait Implementations§
impl<'a, Ctx> Freeze for PosSpec<'a, Ctx>where
Ctx: ?Sized,
impl<'a, Ctx> !RefUnwindSafe for PosSpec<'a, Ctx>
impl<'a, Ctx> !Send for PosSpec<'a, Ctx>
impl<'a, Ctx> !Sync for PosSpec<'a, Ctx>
impl<'a, Ctx> Unpin for PosSpec<'a, Ctx>where
Ctx: ?Sized,
impl<'a, Ctx> !UnwindSafe for PosSpec<'a, Ctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more