Skip to main content

StatefulWidget

Trait StatefulWidget 

Source
pub trait StatefulWidget<B: Backend> {
    type State;

    // Required method
    fn render(self, area: Rect, term: &mut Terminal<B>, state: &mut Self::State);
}
Expand description

Like Widget, but for widgets that read (and may update) externally owned state — a selection index, a scroll offset — that outlives a single render call. See crate::ListState.

Required Associated Types§

Source

type State

The externally owned state this widget reads and/or updates while rendering.

Required Methods§

Source

fn render(self, area: Rect, term: &mut Terminal<B>, state: &mut Self::State)

Draw this widget into area, using and/or updating state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§