Struct nannou::ui::widget::UpdateArgs[][src]

pub struct UpdateArgs<'a, 'b, 'c, 'd, W> where
    'b: 'a,
    'd: 'c,
    W: Widget
{ pub id: NodeIndex<u32>, pub maybe_parent_id: Option<NodeIndex<u32>>, pub prev: &'a CommonState, pub state: &'a mut State<'b, <W as Widget>::State>, pub rect: Rect, pub style: &'a <W as Widget>::Style, pub ui: &'c mut UiCell<'d>, }
Expand description

Arguments for the Widget::update method in a struct to simplify the method signature.

Fields

id: NodeIndex<u32>

The Widget’s unique index.

maybe_parent_id: Option<NodeIndex<u32>>

The Widget’s parent unique index, if there is one.

prev: &'a CommonState

The Widget’s previous state. Specifically, the state that is common between all widgets, such as positioning, floatability, draggability, etc.

state: &'a mut State<'b, <W as Widget>::State>

A wrapper around the Widget’s unique state, providing methods for both immutably viewing and mutably updating the state.

We wrap mutation in a method so that we can keep track of whether or not the unique state has been updated.

If State::update is called, we assume that there has been some mutation and in turn will require re-drawing the Widget. Thus, it is recommended that you only call State::update if you need to update the unique state in some way.

rect: Rect

The rectangle describing the Widget’s area.

style: &'a <W as Widget>::Style

The Widget’s current Widget::Style.

ui: &'c mut UiCell<'d>

Restricted access to the Ui.

Provides methods for immutably accessing the Ui’s Theme and GlyphCache. Also allows calling Widget::set within the Widget::update method.

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.