pub enum Input {
File(EvaluationPath),
Pair {
key: String,
value: Value,
},
}Expand description
An input parsed from the command line.
Variants§
File(EvaluationPath)
A file.
Tuple Fields
§
0: EvaluationPathThe path to the file.
If this input is successfully created, the input is guaranteed to exist at the time the inputs were processed.
Pair
A key-value pair representing an input.
Implementations§
Source§impl Input
impl Input
Sourcepub fn as_file(&self) -> Option<&EvaluationPath>
pub fn as_file(&self) -> Option<&EvaluationPath>
Attempts to return a reference to the inner EvaluationPath.
- If the input is a
Input::File, a reference to the inner path is returned wrapped inSome. - Otherwise,
Noneis returned.
Sourcepub fn into_file(self) -> Option<EvaluationPath>
pub fn into_file(self) -> Option<EvaluationPath>
Consumes self and attempts to return the inner EvaluationPath.
- If the input is a
Input::File, the inner path buffer is returned wrapped inSome. - Otherwise,
Noneis returned.
Sourcepub fn unwrap_file(self) -> EvaluationPath
pub fn unwrap_file(self) -> EvaluationPath
Sourcepub fn as_pair(&self) -> Option<(&str, &Value)>
pub fn as_pair(&self) -> Option<(&str, &Value)>
Attempts to return a reference to the inner key-value pair.
- If the input is a
Input::Pair, a reference to the inner key and value is returned wrapped inSome. - Otherwise,
Noneis returned.
Sourcepub fn into_pair(self) -> Option<(String, Value)>
pub fn into_pair(self) -> Option<(String, Value)>
Consumes self and attempts to return the inner key-value pair.
- If the input is a
Input::Pair, the inner key-value pair is returned wrapped inSome. - Otherwise,
Noneis returned.
Sourcepub fn unwrap_pair(self) -> (String, Value)
pub fn unwrap_pair(self) -> (String, Value)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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