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 + Clone + 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)
Object Safety§
This trait is not object safe.