Skip to main content

GpuiComponentValueBinding

Trait GpuiComponentValueBinding 

Source
pub trait GpuiComponentValueBinding<Value>: GpuiComponentShape
where Self::State: EventEmitter<Self::Event>,
{ type Event: 'static; // Required method fn value_change( state: &Self::State, event: &Self::Event, ) -> ValueChange<Value>; // Provided method fn seed_value_binding_state( _state: &mut Self::State, _value: Option<&Value>, _window: &mut Window, _cx: &mut Context<'_, Self::State>, ) { ... } }
Expand description

Optional value-binding contract for GPUI component shapes.

Required Associated Types§

Source

type Event: 'static

Event emitted by the component state.

Required Methods§

Source

fn value_change(state: &Self::State, 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::State, _value: Option<&Value>, _window: &mut Window, _cx: &mut Context<'_, Self::State>, )

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§