Skip to main content

FromValue

Trait FromValue 

Source
pub trait FromValue:
    Sized
    + Clone
    + Send
    + Sync
    + 'static
    + Sealed {
    type Out<'a>;
}
Expand description

A type an expression can resolve to.

Sealed: the implementations are OwnedDataValue (lent as Cow<OwnedDataValue>), String (Cow<str>; a result that is not a string is its compact JSON), u64 and i64 (themselves: an integer, or a whole float, in the type’s range; above i64::MAX an integer is read as a float and may round; anything else is an error), f64 (itself: any finite number, the only kind JSON carries; anything else is an error), bool (itself; anything else is an error) and Path (Cow<Path>; a string parsed as a path).

Required Associated Types§

Source

type Out<'a>

What an evaluation hands back: a folded constant borrowed from the expression, a dynamic result owned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromValue for OwnedDataValue

Source§

impl FromValue for String

Source§

type Out<'a> = Cow<'a, str>

Source§

impl FromValue for bool

Source§

type Out<'a> = bool

Source§

impl FromValue for f64

Source§

type Out<'a> = f64

Source§

impl FromValue for i64

Source§

type Out<'a> = i64

Source§

impl FromValue for u64

Source§

type Out<'a> = u64

Implementors§

Source§

impl FromValue for Path

Source§

type Out<'a> = Cow<'a, Path>