pub trait Res<T>: ResGet<T> {
// Provided method
fn set_or_bind<F>(self, cx: &mut Context, entity: Entity, closure: F)
where Self: Sized,
F: 'static + Fn(&mut Context, Self) { ... }
}
Expand description
A trait which allows passing a value or a lens to a view or modifier.
For example, the Label
view constructor takes a type which implements Res<T>
where
T
implements ToString
. This allows the user to pass a type which implements ToString
,
such as String
or &str
, or a lens to a type which implements ToString
.
Provided Methods§
fn set_or_bind<F>(self, cx: &mut Context, entity: Entity, closure: F)
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.