Struct Element

Source
pub struct Element<'bp> {
    pub ident: &'bp str,
    /* private fields */
}

Fields§

§ident: &'bp str

Implementations§

Source§

impl<'bp> Element<'bp>

Source

pub fn id(&self) -> WidgetId

Source

pub fn layout( &mut self, children: LayoutForEach<'_, 'bp>, constraints: Constraints, ctx: &mut LayoutCtx<'_, 'bp>, ) -> Result<Layout>

Source

pub fn invalidate_cache(&mut self)

Source

pub fn position( &mut self, children: ForEach<'_, 'bp, PositionFilter>, pos: Pos, attribute_storage: &AttributeStorage<'bp>, viewport: Viewport, )

Position the element

Source

pub fn paint( &mut self, children: ForEach<'_, 'bp, PaintFilter>, ctx: PaintCtx<'_, Unsized>, attribute_storage: &AttributeStorage<'bp>, )

Draw an element to the surface

Source

pub fn cached_size(&self) -> Option<Size>

Return the cached size if the constraints are matching the cached constraints.

Source

pub fn size(&self) -> Size

Source

pub fn inner_bounds(&self) -> Region

Inner bounds in global space

Source

pub fn bounds(&self) -> Region

Bounds in global space

Source

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

Source

pub fn try_to<T: 'static>(&mut self) -> Option<&mut T>

Get a mutable reference to the underlying widget of the given type

Source

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

Source

pub fn try_to_ref<T: 'static>(&self) -> Option<&T>

Get a reference to the underlying widget of the given type

Source

pub fn get_pos(&self) -> Pos

Get the position of the container.

Trait Implementations§

Source§

impl<'bp> Debug for Element<'bp>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.