Struct grab::Builder[][src]

pub struct Builder { /* fields omitted */ }

A Config builder, you can use this struct to customize which parsers are available to be called when attempting to parse input.

If you just want the default configuration, use Config::default and skip this struct completely.

Implementations

impl Builder[src]

pub fn new() -> Self[src]

Create a new, empty config builder

pub fn with<F>(self, f: F) -> Self where
    F: FnMut(&mut Self) -> &mut Self, 
[src]

Convenience function for applying configuration options

pub fn build(self) -> Config[src]

Consume this builder returning a Config that can be used for parsing.

Panics

Panics if there are no parsers set

pub fn try_build(self) -> Result<Config, Self>[src]

Attempt to create a Config from the given parser, if the current configuration is valid, returning the builder otherwise.

This is the safe variant of build

pub fn text(&mut self) -> &mut Self[src]

Enable text parsing, with the default parser

pub fn with_text(&mut self, t: Text) -> &mut Self[src]

Enable text parsing, with the given parser

pub fn stdin(&mut self) -> &mut Self[src]

Enable stdin parsing with the default parser

pub fn with_stdin(&mut self, s: Stdin) -> &mut Self[src]

Enable stdin parsing, using the given parser

pub fn file(&mut self) -> &mut Self[src]

Enable file path parsing with the default parser

pub fn with_file(&mut self, f: File) -> &mut Self[src]

Enable file path parsing, using the given parser

pub fn is_valid(&self) -> bool[src]

Checks if you can successfully convert into a Config

Trait Implementations

impl Clone for Builder[src]

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.