#[repr(u8)]pub enum JsonOutput {
Single(String),
Multiple(Vec<String>),
}Expand description
Output type for JSON flattening operations
Variants§
Implementations§
Source§impl JsonOutput
impl JsonOutput
Sourcepub fn into_single(self) -> String
👎Deprecated since 0.10.0: Use try_into_single() instead to avoid panics
pub fn into_single(self) -> String
Use try_into_single() instead to avoid panics
Extract single result, panicking if multiple results.
§Panics
Panics if this is a Multiple variant. Use try_into_single
for a non-panicking alternative.
Sourcepub fn into_multiple(self) -> Vec<String>
👎Deprecated since 0.10.0: Use try_into_multiple() instead to avoid panics
pub fn into_multiple(self) -> Vec<String>
Use try_into_multiple() instead to avoid panics
Extract multiple results, panicking if single result.
§Panics
Panics if this is a Single variant. Use try_into_multiple
for a non-panicking alternative.
Sourcepub fn try_into_single(self) -> Result<String, JsonToolsError>
pub fn try_into_single(self) -> Result<String, JsonToolsError>
Try to extract single result, returning an error if multiple results.
Sourcepub fn try_into_multiple(self) -> Result<Vec<String>, JsonToolsError>
pub fn try_into_multiple(self) -> Result<Vec<String>, JsonToolsError>
Try to extract multiple results, returning an error if single result.
Trait Implementations§
Source§impl Clone for JsonOutput
impl Clone for JsonOutput
Source§fn clone(&self) -> JsonOutput
fn clone(&self) -> JsonOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 JsonOutput
impl RefUnwindSafe for JsonOutput
impl Send for JsonOutput
impl Sync for JsonOutput
impl Unpin for JsonOutput
impl UnsafeUnpin for JsonOutput
impl UnwindSafe for JsonOutput
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