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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.