Skip to main content

FromProps

Trait FromProps 

Source
pub trait FromProps<'kv> {
    // Required method
    fn from_props<P>(props: &'kv P) -> Self
       where P: Props + ?Sized;
}
Expand description

A type that can be constructed from Props.

This trait is like the standard library’s FromIterator, but for Props instead of Iterator.

Required Methods§

Source

fn from_props<P>(props: &'kv P) -> Self
where P: Props + ?Sized,

Convert from P.

Implementors of this method may re-order or deduplicate key-values in props. If any deduplication occurs, it must take the first value seen for a given key.

If props is empty, this method should return a default, empty Self.

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<'kv, 'a, C> FromProps<'kv> for Arc<C>
where C: FromProps<'kv> + 'a,

Available on crate feature alloc only.
Source§

fn from_props<P>(props: &'kv P) -> Arc<C>
where P: Props + ?Sized,

Source§

impl<'kv, 'a, C> FromProps<'kv> for Box<C>
where C: FromProps<'kv> + 'a,

Available on crate feature alloc only.
Source§

fn from_props<P>(props: &'kv P) -> Box<C>
where P: Props + ?Sized,

Source§

impl<'kv, K, V> FromProps<'kv> for BTreeMap<K, V>
where K: Ord + From<Str<'kv>>, V: From<Value<'kv>>,

Source§

fn from_props<P>(props: &'kv P) -> BTreeMap<K, V>
where P: Props + ?Sized,

Source§

impl<'kv, K, V> FromProps<'kv> for HashMap<K, V>
where K: Eq + Hash + From<Str<'kv>>, V: From<Value<'kv>>,

Source§

fn from_props<P>(props: &'kv P) -> HashMap<K, V>
where P: Props + ?Sized,

Source§

impl<'kv, K, V> FromProps<'kv> for Vec<(K, V)>
where K: From<Str<'kv>>, V: From<Value<'kv>>,

Source§

fn from_props<P>(props: &'kv P) -> Vec<(K, V)>
where P: Props + ?Sized,

Implementors§

Source§

impl<'kv> FromProps<'kv> for OwnedProps