Struct gpui2::AnyElement
source · pub struct AnyElement(_);
Implementations§
source§impl AnyElement
impl AnyElement
pub fn new<E>(element: E) -> Selfwhere E: 'static + Element, E::State: Any,
pub fn element_id(&self) -> Option<ElementId>
pub fn layout(&mut self, cx: &mut WindowContext<'_>) -> LayoutId
pub fn paint(self, cx: &mut WindowContext<'_>)
sourcepub fn measure(
&mut self,
available_space: Size<AvailableSpace>,
cx: &mut WindowContext<'_>
) -> Size<Pixels>
pub fn measure( &mut self, available_space: Size<AvailableSpace>, cx: &mut WindowContext<'_> ) -> Size<Pixels>
Initializes this element and performs layout within the given available space to determine its size.
sourcepub fn draw(
self,
origin: Point<Pixels>,
available_space: Size<AvailableSpace>,
cx: &mut WindowContext<'_>
)
pub fn draw( self, origin: Point<Pixels>, available_space: Size<AvailableSpace>, cx: &mut WindowContext<'_> )
Initializes this element and performs layout in the available space, then paints it at the given origin.
sourcepub fn into_any(self) -> AnyElement
pub fn into_any(self) -> AnyElement
Converts this AnyElement
into a trait object that can be stored and manipulated.
Trait Implementations§
source§impl Element for AnyElement
impl Element for AnyElement
source§impl RenderOnce for AnyElement
impl RenderOnce for AnyElement
type Element = AnyElement
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for AnyElement
impl !Send for AnyElement
impl !Sync for AnyElement
impl Unpin for AnyElement
impl !UnwindSafe for AnyElement
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