Struct termit::widget::WidgetBinder

source ·
pub struct WidgetBinder<W, M, A: AppEvent> {
    pub bound_widget: W,
    /* private fields */
}
Expand description

Fields§

§bound_widget: W

Trait Implementations§

source§

impl<'a, W, M, A: AppEvent> AnchorPlacementEnabled for WidgetBinder<W, M, A>

source§

fn place(self) -> PlacedWidget<Self>

Enabling method called by the related AnchorPlaced impl
source§

impl<W: Default, M: Default, A: Default + AppEvent> Default for WidgetBinder<W, M, A>

source§

fn default() -> WidgetBinder<W, M, A>

Returns the “default value” for a type. Read more
source§

impl<'a, W, M, A: AppEvent> Widget<M, A> for WidgetBinder<W, M, A>where W: Widget<M, A>,

source§

fn update( &mut self, model: &mut M, input: &Event<A>, screen: &mut Screen, painter: &Painter ) -> Window

Do the widget magic. The returned scope must be contained in the painter AND screen scopes
source§

fn update_asserted( &mut self, model: &mut M, input: &Event<A>, screen: &mut Screen, painter: &Painter ) -> Window

calls update and checks returned scope to conform to requirements in debug builds

Auto Trait Implementations§

§

impl<W, M, A> !RefUnwindSafe for WidgetBinder<W, M, A>

§

impl<W, M, A> !Send for WidgetBinder<W, M, A>

§

impl<W, M, A> !Sync for WidgetBinder<W, M, A>

§

impl<W, M, A> Unpin for WidgetBinder<W, M, A>where W: Unpin,

§

impl<W, M, A> !UnwindSafe for WidgetBinder<W, M, A>

Blanket Implementations§

source§

impl<T> AnchorPlaced for Twhere T: AnchorPlacementEnabled,

§

type Placed = PlacedWidget<T>

source§

fn left(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how far from the left?
source§

fn top(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how far from the top?
source§

fn right(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how far from the right?
source§

fn bottom(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how far from the botton?
source§

fn height(self, size: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how high?
source§

fn width(self, size: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed

how wide?
source§

fn fill(self) -> <T as AnchorPlaced>::Placed

reset to fill the whole area
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, M, A> WidgetExt<M, A> for Twhere A: AppEvent, T: Widget<M, A>,

source§

fn bind_with( self, loader: impl Fn(&mut T, &M) + 'static, saver: impl Fn(&T, &mut M) + 'static ) -> WidgetBinder<T, M, A>

Decorate the given widget with a loader and saver. Read more
source§

fn replace_with( self, loader: impl Fn(T, &M) -> T + 'static ) -> WidgetBinder<T, M, A>where T: Default,

source§

fn load_with( self, loader: impl Fn(&mut T, &M) + 'static ) -> WidgetBinder<T, M, A>

A variation on bind_with, only a loader
source§

fn save_with( self, saver: impl Fn(&T, &mut M) + 'static ) -> WidgetBinder<T, M, A>

A variation on bind_with, only a saver
source§

fn bind_property<FW, FM, D>( self, widget_property: FW, model_property: FM ) -> WidgetPropertyBinder<T, M, D, A>where FW: Fn(&mut T) -> &mut D + 'static, FM: Fn(&mut M) -> &mut D + 'static, D: Default,

A variation on bind_with, bind specific model and widget properties