pub struct Element<'bp> {
pub ident: &'bp str,
/* private fields */
}Fields§
§ident: &'bp strImplementations§
Source§impl<'bp> Element<'bp>
impl<'bp> Element<'bp>
pub fn id(&self) -> WidgetId
pub fn layout( &mut self, children: LayoutForEach<'_, 'bp>, constraints: Constraints, ctx: &mut LayoutCtx<'_, 'bp>, ) -> Result<Layout>
pub fn invalidate_cache(&mut self)
Sourcepub fn position(
&mut self,
children: ForEach<'_, 'bp, PositionFilter>,
pos: Pos,
attribute_storage: &AttributeStorage<'bp>,
viewport: Viewport,
)
pub fn position( &mut self, children: ForEach<'_, 'bp, PositionFilter>, pos: Pos, attribute_storage: &AttributeStorage<'bp>, viewport: Viewport, )
Position the element
Sourcepub fn paint(
&mut self,
children: ForEach<'_, 'bp, PaintFilter>,
ctx: PaintCtx<'_, Unsized>,
attribute_storage: &AttributeStorage<'bp>,
)
pub fn paint( &mut self, children: ForEach<'_, 'bp, PaintFilter>, ctx: PaintCtx<'_, Unsized>, attribute_storage: &AttributeStorage<'bp>, )
Draw an element to the surface
Sourcepub fn cached_size(&self) -> Option<Size>
pub fn cached_size(&self) -> Option<Size>
Return the cached size if the constraints are matching the cached constraints.
pub fn size(&self) -> Size
Sourcepub fn inner_bounds(&self) -> Region
pub fn inner_bounds(&self) -> Region
Inner bounds in global space
Sourcepub fn to<T: 'static>(&mut self) -> &mut T
pub fn to<T: 'static>(&mut self) -> &mut T
Get a mutable reference to the underlying widget of the given type
§Panics
Panics if the element is of a different type
Sourcepub fn try_to<T: 'static>(&mut self) -> Option<&mut T>
pub fn try_to<T: 'static>(&mut self) -> Option<&mut T>
Get a mutable reference to the underlying widget of the given type
Sourcepub fn to_ref<T: 'static>(&self) -> &T
pub fn to_ref<T: 'static>(&self) -> &T
Get a reference to the underlying widget of the given type
§Panics
Panics if hte element is of a different type
Sourcepub fn try_to_ref<T: 'static>(&self) -> Option<&T>
pub fn try_to_ref<T: 'static>(&self) -> Option<&T>
Get a reference to the underlying widget of the given type
Trait Implementations§
Auto Trait Implementations§
impl<'bp> Freeze for Element<'bp>
impl<'bp> !RefUnwindSafe for Element<'bp>
impl<'bp> !Send for Element<'bp>
impl<'bp> !Sync for Element<'bp>
impl<'bp> Unpin for Element<'bp>
impl<'bp> !UnwindSafe for Element<'bp>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more