[][src]Struct nannou::ui::prelude::widget::id::Generator

pub struct Generator<'a> { /* fields omitted */ }

Used for generating new unique widget::Ids.

Generator is used by the widget_ids! macro and the types and fields that it generates in order to generate unique widget::Ids for each of the generated fields.

Methods

impl<'a> Generator<'a>[src]

pub fn new(widget_graph: &'a mut Graph) -> Generator<'a>[src]

Constructor for a new widget::Id generator.

pub fn next(&mut self) -> NodeIndex<u32>[src]

Generate a new, unique widget::Id into a Placeholder node within the widget graph. This should only be called once for each unique widget needed to avoid unnecessary bloat within the Ui's widget graph.

When using this method, be sure to store the returned widget::Id somewhere so that it can be re-used on next update.

Panics if adding another node would exceed the maximum capacity for node indices.

Auto Trait Implementations

impl<'a> Send for Generator<'a>

impl<'a> !Sync for Generator<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]

impl<T> SafeBorrow<T> for T[src]

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.