Struct termit::widget::PlacedWidget

source ·
pub struct PlacedWidget<W> {
    pub content: W,
    pub placement: AnchorPlacement,
}
Expand description

Placement widget decorator

Constrains the placed_widgets’s scope.

Wraps widgets that implement AnchorPlacementEnabled.

Fields§

§content: W§placement: AnchorPlacement

Implementations§

source§

impl<W> PlacedWidget<W>

source

pub fn new(content: W) -> PlacedWidget<W>

Trait Implementations§

source§

impl<W> AnchorPlaced for PlacedWidget<W>

§

type Placed = PlacedWidget<W>

source§

fn left(self, offset: impl Into<Option<u16>>) -> Self

how far from the left?
source§

fn right(self, offset: impl Into<Option<u16>>) -> Self

how far from the right?
source§

fn top(self, offset: impl Into<Option<u16>>) -> Self

how far from the top?
source§

fn bottom(self, offset: impl Into<Option<u16>>) -> Self

how far from the botton?
source§

fn width(self, size: impl Into<Option<u16>>) -> Self

how wide?
source§

fn height(self, size: impl Into<Option<u16>>) -> Self

how high?
source§

fn fill(self) -> Self

reset to fill the whole area
source§

impl<W: Default> Default for PlacedWidget<W>

source§

fn default() -> PlacedWidget<W>

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

impl<'a, M, W, A: AppEvent> Widget<M, A> for PlacedWidget<W>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> RefUnwindSafe for PlacedWidget<W>where W: RefUnwindSafe,

§

impl<W> Send for PlacedWidget<W>where W: Send,

§

impl<W> Sync for PlacedWidget<W>where W: Sync,

§

impl<W> Unpin for PlacedWidget<W>where W: Unpin,

§

impl<W> UnwindSafe for PlacedWidget<W>where W: UnwindSafe,

Blanket Implementations§

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