Skip to main content

GpuiComponentStateValueBinding

Trait GpuiComponentStateValueBinding 

Source
pub trait GpuiComponentStateValueBinding<Value>: EventEmitter<Self::Event> {
    type Event: 'static;

    // Required method
    fn value_change(state: &Self, event: &Self::Event) -> ValueChange<Value>;

    // Provided method
    fn seed_value_binding_state(
        _state: &mut Self,
        _value: Option<&Value>,
        _window: &mut Window,
        _cx: &mut Context<'_, Self>,
    )
       where Self: Sized { ... }
}
Expand description

Value-binding contract implemented by backing component state.

Required Associated Types§

Source

type Event: 'static

Event emitted by the backing component state.

Required Methods§

Source

fn value_change(state: &Self, event: &Self::Event) -> ValueChange<Value>

Convert an emitted component event into a normalized value change.

Provided Methods§

Source

fn seed_value_binding_state( _state: &mut Self, _value: Option<&Value>, _window: &mut Window, _cx: &mut Context<'_, Self>, )
where Self: Sized,

Seed component state from the current value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§