pub enum ParseVal {
Bool(bool),
Num(i64),
String(String),
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.
String(String)
A string option.
List(Vec<ParseVal>)
A list of values.
OutStream(OutputFile)
An output stream (stdout, stderr, file name)
Implementations§
Source§impl ParseVal
impl ParseVal
pub fn bool(&self) -> bool
pub fn num(&self) -> i64
pub fn string(&self) -> String
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 Freeze for ParseVal
impl RefUnwindSafe for ParseVal
impl Send for ParseVal
impl Sync for ParseVal
impl Unpin for ParseVal
impl UnwindSafe for ParseVal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more