pub trait TryIntoValue: Sized {
// Required method
fn try_into_value(self, span: Span) -> Result<Value, ShellError>;
}
Expand description
A trait for trying to convert a value into a Value
.
Types like streams may fail while collecting the Value
,
for these types it is useful to implement a fallible variant.
This conversion is fallible, for infallible conversions use IntoValue
.
All types that implement IntoValue
will automatically implement this trait.
Required Methods§
sourcefn try_into_value(self, span: Span) -> Result<Value, ShellError>
fn try_into_value(self, span: Span) -> Result<Value, ShellError>
Tries to convert the given value into a Value
.
Object Safety§
This trait is not object safe.