pub enum OutputResult {
Raw(String),
Json(HashMap<String, OutputValue>),
Single(OutputValue),
Plain(CommandOutput),
}Expand description
Result from an output command.
The variant returned depends on which flags were set on the command:
.json()returnsOutputResult::JsonorOutputResult::Single.raw()returnsOutputResult::Raw- Neither returns
OutputResult::Plain
Variants§
Raw(String)
Raw string value from -raw flag.
Json(HashMap<String, OutputValue>)
All output values as JSON (when .json() and no .name()).
Single(OutputValue)
Single output value as JSON (when .json() and .name()).
Plain(CommandOutput)
Plain command output (no -json or -raw).
Trait Implementations§
Source§impl Clone for OutputResult
impl Clone for OutputResult
Source§fn clone(&self) -> OutputResult
fn clone(&self) -> OutputResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OutputResult
impl RefUnwindSafe for OutputResult
impl Send for OutputResult
impl Sync for OutputResult
impl Unpin for OutputResult
impl UnsafeUnpin for OutputResult
impl UnwindSafe for OutputResult
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