Trait vizia::binding::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 + 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§

source

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§

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<PositionType> for PositionType

source§

impl Res<Units> for Units

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<TextAlign> for TextAlign

source§

impl Res<TextOverflow> for TextOverflow

source§

impl Res<Transform> for Transform

source§

impl Res<Visibility> for Visibility

source§

impl Res<AvatarVariant> for AvatarVariant

source§

impl Res<ButtonVariant> for ButtonVariant

source§

impl Res<ChipVariant> for ChipVariant

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<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,