Skip to main content

OptionInstance

Trait OptionInstance 

Source
pub trait OptionInstance<'s>: Instance<'s> {
    // Required methods
    fn value<'a>(&'a self) -> Option<Value<'a, 's>>
       where 's: 'a;
    fn boxed_clone(&self) -> Box<dyn OptionInstance<'s> + 's>;
    fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>;
}
Expand description

A reflected Option

Required Methods§

Source

fn value<'a>(&'a self) -> Option<Value<'a, 's>>
where 's: 'a,

Returns a reference to a field in a reflected vec

Source

fn boxed_clone(&self) -> Box<dyn OptionInstance<'s> + 's>

Returns a clone of the instance in a Box.

Source

fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'s> + 's>

Trait Implementations§

Source§

impl<'s> Clone for Box<dyn OptionInstance<'s> + 's>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'s> Debug for dyn OptionInstance<'s> + 's

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'val, 'ty> FromValue<'val, 'ty> for &'val (dyn OptionInstance<'ty> + 'ty)

Source§

fn from_value(value: &Value<'val, 'ty>) -> Option<Self>

Source§

impl<'s> PartialEq for dyn OptionInstance<'s> + 's

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'ty, T: Typed<'ty> + Clone + 'ty> OptionInstance<'ty> for Option<T>

Source§

fn value<'val>(&'val self) -> Option<Value<'val, 'ty>>
where 'ty: 'val,

Source§

fn boxed_clone(&self) -> Box<dyn OptionInstance<'ty> + 'ty>

Source§

fn into_boxed_instance(self: Box<Self>) -> Box<dyn Instance<'ty> + 'ty>

Implementors§