Struct druid::widget::IdentityWrapper
source · pub struct IdentityWrapper<W> { /* private fields */ }
Expand description
A wrapper that adds an identity to an otherwise anonymous widget.
Implementations§
source§impl<W> IdentityWrapper<W>
impl<W> IdentityWrapper<W>
sourcepub fn wrap(child: W, id: WidgetId) -> IdentityWrapper<W>
pub fn wrap(child: W, id: WidgetId) -> IdentityWrapper<W>
Assign an identity to a widget.
Trait Implementations§
source§impl<T: Data, W: Widget<T>> Widget<T> for IdentityWrapper<W>
impl<T: Data, W: Widget<T>> Widget<T> for IdentityWrapper<W>
source§fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut T,
env: &Env
)
fn event( &mut self, ctx: &mut EventCtx<'_, '_>, event: &Event, data: &mut T, env: &Env )
Handle an event. Read more
source§fn lifecycle(
&mut self,
ctx: &mut LifeCycleCtx<'_, '_>,
event: &LifeCycle,
data: &T,
env: &Env
)
fn lifecycle( &mut self, ctx: &mut LifeCycleCtx<'_, '_>, event: &LifeCycle, data: &T, env: &Env )
Handle a life cycle notification. Read more
source§fn layout(
&mut self,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> Size
fn layout( &mut self, ctx: &mut LayoutCtx<'_, '_>, bc: &BoxConstraints, data: &T, env: &Env ) -> Size
Compute layout. Read more
source§fn paint(&mut self, ctx: &mut PaintCtx<'_, '_, '_>, data: &T, env: &Env)
fn paint(&mut self, ctx: &mut PaintCtx<'_, '_, '_>, data: &T, env: &Env)
Paint the widget appearance. Read more
source§fn compute_max_intrinsic(
&mut self,
axis: Axis,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> f64
fn compute_max_intrinsic( &mut self, axis: Axis, ctx: &mut LayoutCtx<'_, '_>, bc: &BoxConstraints, data: &T, env: &Env ) -> f64
Computes max intrinsic/preferred dimension of a widget on the provided axis. Read more
source§impl<W> WidgetWrapper for IdentityWrapper<W>
impl<W> WidgetWrapper for IdentityWrapper<W>
§type Wrapped = W
type Wrapped = W
The type of the wrapped widget.
Maybe we would like to constrain this to
Widget<impl Data>
(if existential bounds were supported).
Any other scheme leads to T
being unconstrained in unification at some pointsource§fn wrapped_mut(&mut self) -> &mut Self::Wrapped
fn wrapped_mut(&mut self) -> &mut Self::Wrapped
Get mutable access to the wrapped child
Auto Trait Implementations§
impl<W> RefUnwindSafe for IdentityWrapper<W>where W: RefUnwindSafe,
impl<W> Send for IdentityWrapper<W>where W: Send,
impl<W> Sync for IdentityWrapper<W>where W: Sync,
impl<W> Unpin for IdentityWrapper<W>where W: Unpin,
impl<W> UnwindSafe for IdentityWrapper<W>where W: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.