vizia::binding

Trait Res

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)
where Self: Sized, F: 'static + Clone + Fn(&mut Context, Self),

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Res<bool> for bool

§

impl Res<char> for char

§

impl Res<f32> for f32

§

impl Res<f64> for f64

§

impl Res<i8> for i8

§

impl Res<i16> for i16

§

impl Res<i32> for i32

§

impl Res<i64> for i64

§

impl Res<i128> for i128

§

impl Res<isize> for isize

§

impl Res<u8> for u8

§

impl Res<u16> for u16

§

impl Res<u32> for u32

§

impl Res<u64> for u64

§

impl Res<u128> for u128

§

impl Res<usize> for usize

§

impl Res<String> for String

§

impl<'s> Res<&'s str> for &'s str

§

impl<'s> Res<&'s String> for &'s String

§

impl<T1, T2> Res<(T1, T2)> for (T1, T2)
where T1: Clone, T2: Clone,

§

impl<T1, T2, T3> Res<(T1, T2, T3)> for (T1, T2, T3)
where T1: Clone, T2: Clone, T3: Clone,

§

impl<T1, T2, T3, T4> Res<(T1, T2, T3, T4)> for (T1, T2, T3, T4)
where T1: Clone, T2: Clone, T3: Clone, T4: Clone,

§

impl<T> Res<Option<T>> for Option<T>
where T: Clone + ResGet<T>,

§

impl<T> Res<Vec<T>> for Vec<T>
where T: Clone + ResGet<T>,

§

impl<T, const N: usize> Res<[T; N]> for [T; N]
where T: Clone + ResGet<T>,

Implementors§

§

impl Res<LayoutType> for LayoutType

§

impl Res<PositionType> for PositionType

§

impl Res<Units> for Units

§

impl Res<Angle> for Angle

§

impl Res<Color> for Color

§

impl Res<CornerShape> for CornerShape

§

impl Res<CursorIcon> for CursorIcon

§

impl Res<Display> for Display

§

impl Res<FamilyOwned> for FamilyOwned

§

impl Res<Filter> for Filter

§

impl Res<FontSlant> for FontSlant

§

impl Res<FontWeightKeyword> for FontWeightKeyword

§

impl Res<FontWidth> for FontWidth

§

impl Res<Length> for Length

§

impl Res<LengthOrPercentage> for LengthOrPercentage

§

impl Res<LengthValue> for LengthValue

§

impl Res<Overflow> for Overflow

§

impl Res<PointerEvents> for PointerEvents

§

impl Res<TextAlign> for TextAlign

§

impl Res<TextOverflow> for TextOverflow

§

impl Res<Transform> for Transform

§

impl Res<Visibility> for Visibility

§

impl Res<AvatarVariant> for AvatarVariant

§

impl Res<ButtonVariant> for ButtonVariant

§

impl Res<ChipVariant> for ChipVariant

§

impl Res<Placement> for Placement

§

impl Res<Selectable> for Selectable

§

impl Res<SpinboxIcons> for SpinboxIcons

§

impl Res<LinearGradientBuilder> for LinearGradientBuilder

§

impl Res<ShadowBuilder> for ShadowBuilder

§

impl Res<FontVariation> for FontVariation

§

impl Res<FontWeight> for FontWeight

§

impl Res<LineClamp> for LineClamp

§

impl Res<LinearGradient> for LinearGradient

§

impl Res<Opacity> for Opacity

§

impl Res<Position> for Position

§

impl Res<RGBA> for RGBA

§

impl Res<Scale> for Scale

§

impl Res<Shadow> for Shadow

§

impl Res<TextDecorationLine> for TextDecorationLine

§

impl Res<Translate> for Translate

§

impl Res<String> for Localized

§

impl<'i> Res<BackgroundImage<'i>> for BackgroundImage<'i>

§

impl<'i> Res<FontFamily<'i>> for FontFamily<'i>

§

impl<L> Res<<L as Lens>::Target> for L
where L: Lens, <L as Lens>::Target: Data,