pub enum ParseVal {
Bool(bool),
Num(i64),
List(Vec<ParseVal>),
OutStream(OutputFile),
}
Expand description
The value returned from parsing an option.
Variants
Bool(bool)
A boolean option.
Num(i64)
A number option.
List(Vec<ParseVal>)
A list of values.
OutStream(OutputFile)
An output stream (stdout, stderr, file name)
Implementations
sourceimpl ParseVal
impl ParseVal
pub fn bool(&self) -> bool
pub fn num(&self) -> i64
pub fn pos_num(&self) -> Option<u64>
pub fn num_list(&self) -> Vec<i64>
sourcepub fn num_list_exact<const N: usize>(&self) -> [Option<i64>; N]
pub fn num_list_exact<const N: usize>(&self) -> [Option<i64>; N]
Parse a list that should have exactly N elements. If elements are missing, then add None to the end of the list.
sourcepub fn not_null_outstream(&self) -> Option<OutputFile>
pub fn not_null_outstream(&self) -> Option<OutputFile>
Returns an output stream if it is not the null stream
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ParseVal
impl Send for ParseVal
impl Sync for ParseVal
impl Unpin for ParseVal
impl UnwindSafe for ParseVal
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more