vizia::binding

Trait Res

Source
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§

Source

fn set_or_bind<F>(self, cx: &mut Context, entity: Entity, closure: F)
where Self: Sized, F: 'static + Fn(&mut Context, Self),

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.

Implementations on Foreign Types§

Source§

impl Res<bool> for bool

Source§

impl Res<char> for char

Source§

impl Res<f32> for f32

Source§

impl Res<f64> for f64

Source§

impl Res<i8> for i8

Source§

impl Res<i16> for i16

Source§

impl Res<i32> for i32

Source§

impl Res<i64> for i64

Source§

impl Res<i128> for i128

Source§

impl Res<isize> for isize

Source§

impl Res<u8> for u8

Source§

impl Res<u16> for u16

Source§

impl Res<u32> for u32

Source§

impl Res<u64> for u64

Source§

impl Res<u128> for u128

Source§

impl Res<usize> for usize

Source§

impl Res<String> for String

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl Res<LayoutType> for LayoutType

Source§

impl Res<Units> for Units

Source§

impl Res<Alignment> for Alignment

Source§

impl Res<Angle> for Angle

Source§

impl Res<Color> for Color

Source§

impl Res<CornerShape> for CornerShape

Source§

impl Res<CursorIcon> for CursorIcon

Source§

impl Res<Display> for Display

Source§

impl Res<FamilyOwned> for FamilyOwned

Source§

impl Res<Filter> for Filter

Source§

impl Res<FontSlant> for FontSlant

Source§

impl Res<FontWeightKeyword> for FontWeightKeyword

Source§

impl Res<FontWidth> for FontWidth

Source§

impl Res<Length> for Length

Source§

impl Res<LengthOrPercentage> for LengthOrPercentage

Source§

impl Res<LengthValue> for LengthValue

Source§

impl Res<Overflow> for Overflow

Source§

impl Res<PointerEvents> for PointerEvents

Source§

impl Res<PositionType> for PositionType

Source§

impl Res<TextAlign> for TextAlign

Source§

impl Res<TextOverflow> for TextOverflow

Source§

impl Res<TextStrokeStyle> for TextStrokeStyle

Source§

impl Res<Transform> for Transform

Source§

impl Res<Visibility> for Visibility

Source§

impl Res<AvatarVariant> for AvatarVariant

Source§

impl Res<BadgePlacement> for BadgePlacement

Source§

impl Res<ButtonVariant> for ButtonVariant

Source§

impl Res<ChipVariant> for ChipVariant

Source§

impl Res<Orientation> for Orientation

Source§

impl Res<Placement> for Placement

Source§

impl Res<Selectable> for Selectable

Source§

impl Res<SpinboxIcons> for SpinboxIcons

Source§

impl Res<LinearGradientBuilder> for LinearGradientBuilder

Source§

impl Res<ShadowBuilder> for ShadowBuilder

Source§

impl Res<FontVariation> for FontVariation

Source§

impl Res<FontWeight> for FontWeight

Source§

impl Res<LineClamp> for LineClamp

Source§

impl Res<LinearGradient> for LinearGradient

Source§

impl Res<Opacity> for Opacity

Source§

impl Res<Position> for Position

Source§

impl Res<RGBA> for RGBA

Source§

impl Res<Scale> for Scale

Source§

impl Res<Shadow> for Shadow

Source§

impl Res<TextDecorationLine> for TextDecorationLine

Source§

impl Res<TextStroke> for TextStroke

Source§

impl Res<Translate> for Translate

Source§

impl Res<String> for Localized

Source§

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

Source§

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

Source§

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