pub trait ResGet<T> {
// Required methods
fn get_ref<'a>(
&'a self,
cx: &'a impl DataContext,
) -> Option<LensValue<'a, T>>;
fn get(&self, _: &impl DataContext) -> T;
}
Expand description
A trait for retrieving the value of a lens.
Required Methods§
Sourcefn get_ref<'a>(&'a self, cx: &'a impl DataContext) -> Option<LensValue<'a, T>>
fn get_ref<'a>(&'a self, cx: &'a impl DataContext) -> Option<LensValue<'a, T>>
Returns the value of a lens by reference.
Sourcefn get(&self, _: &impl DataContext) -> T
fn get(&self, _: &impl DataContext) -> T
returns the value of a lens by 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.