pub struct Builder<S, P = At<()>> { /* private fields */ }Implementations§
source§impl<S, P> Builder<S, P>
impl<S, P> Builder<S, P>
pub fn map<T, F: Fn(P::Value) -> T>(
self,
map: F
) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<T, Error>>>where
P: Parse,
pub fn try_map<T, F: Fn(P::Value) -> Result<T, Error>>(
self,
map: F
) -> Builder<S, Map<P, F>>where
P: Parse,
pub fn filter(
self,
filter: impl Fn(&P::Value) -> bool
) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<Option<P::Value>, Error>>>where
P: Parse,
pub fn filter_or(
self,
error: impl Into<Error>,
filter: impl Fn(&P::Value) -> bool
) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<P::Value, Error>>>where
P: Parse,
pub fn or<T>( self, error: impl Into<Error> ) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<T, Error>>>
pub fn boxed(
self
) -> Builder<S, Box<dyn Parse<Value = P::Value, State = P::State>>>where
P: Parse + 'static,
pub fn any<T>( self ) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<Option<T>, Error>>>
pub fn any_or<T>( self, error: impl Into<Error> ) -> Builder<S, Map<P, impl Fn(P::Value) -> Result<T, Error>>>
source§impl<S: Node, P> Builder<S, P>
impl<S: Node, P> Builder<S, P>
pub fn usage(self, usage: impl Into<Cow<'static, str>>) -> Self
pub fn group<Q>(
self,
build: impl FnOnce(Builder<Group, At>) -> Builder<Group, Q>
) -> Builder<S, P::Push<Q>>where
P: Stack,
pub fn verb<Q>(
self,
build: impl FnOnce(Builder<Verb, At>) -> Builder<Verb, Q>
) -> Builder<S, P::Push<Node<Q>>>where
P: Stack,
pub fn option<T: FromStr + 'static, Q>(
self,
build: impl FnOnce(Builder<Option, Value<T>>) -> Builder<Option, Q>
) -> Builder<S, P::Push<With<Q>>>where
P: Stack,
pub fn options(self, options: impl IntoIterator<Item = Options>) -> Self
source§impl<P> Builder<Option, P>
impl<P> Builder<Option, P>
pub fn name(self, name: impl Into<Cow<'static, str>>) -> Self
pub fn position(self) -> Self
pub fn swizzle(self) -> Self
pub fn default<T: Clone + Debug>( self, default: impl Into<T> ) -> Builder<Option, Default<P, impl Fn() -> T>>
pub fn default_with<T, F: Fn() -> T>( self, default: F, format: impl Into<Cow<'static, str>> ) -> Builder<Option, Default<P, F>>
pub fn environment<T: FromStr>( self, variable: impl Into<Cow<'static, str>> ) -> Builder<Option, Environment<P, impl Fn(&str) -> Option<T>>>
pub fn environment_with<T, F: Fn(&str) -> Option<T>>( self, variable: impl Into<Cow<'static, str>>, parse: F ) -> Builder<Option, Environment<P, F>>
pub fn require(self) -> Builder<Option, Require<P>>
pub fn many<T, I: Default + Extend<T>>( self ) -> Builder<Option, Many<P, I, impl Fn() -> I, impl Fn(&mut I, T)>>
pub fn many_with<T, I, N: Fn() -> I, F: Fn(&mut I, T)>( self, per: Option<NonZeroUsize>, new: N, add: F ) -> Builder<Option, Many<P, I, N, F>>
pub fn valid(self, pattern: impl Into<Cow<'static, str>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<S, P> RefUnwindSafe for Builder<S, P>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, P> Send for Builder<S, P>
impl<S, P> Sync for Builder<S, P>
impl<S, P> Unpin for Builder<S, P>
impl<S, P> UnwindSafe for Builder<S, P>where
P: UnwindSafe,
S: UnwindSafe,
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