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

§

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 Res<Range<f32>> for Range<f32>

§

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

§

impl Res<Anchor> for Anchor

§

impl Res<AnchorTarget> for AnchorTarget

§

impl Res<Angle> for Angle

§

impl Res<AvatarVariant> for AvatarVariant

§

impl Res<BadgePlacement> for BadgePlacement

§

impl Res<ButtonVariant> for ButtonVariant

§

impl Res<ChipVariant> for ChipVariant

§

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

§

impl Res<Length> for Length

§

impl Res<LengthOrPercentage> for LengthOrPercentage

§

impl Res<LengthValue> for LengthValue

§

impl Res<Orientation> for Orientation

§

impl Res<Overflow> for Overflow

§

impl Res<Placement> for Placement

§

impl Res<PointerEvents> for PointerEvents

§

impl Res<PositionType> for PositionType

§

impl Res<Selectable> for Selectable

§

impl Res<SpinboxIcons> for SpinboxIcons

§

impl Res<TextAlign> for TextAlign

§

impl Res<TextOverflow> for TextOverflow

§

impl Res<TextStrokeStyle> for TextStrokeStyle

§

impl Res<Transform> for Transform

§

impl Res<Units> for Units

§

impl Res<Visibility> for Visibility

§

impl Res<String> for Localized

§

impl Res<FontVariation> for FontVariation

§

impl Res<FontWeight> for FontWeight

§

impl Res<LineClamp> for LineClamp

§

impl Res<LinearGradient> for LinearGradient

§

impl Res<LinearGradientBuilder> for LinearGradientBuilder

§

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

§

impl Res<TextDecorationLine> for TextDecorationLine

§

impl Res<TextStroke> for TextStroke

§

impl Res<Translate> for Translate

§

impl Res<WindowPosition> for WindowPosition

§

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,