Trait gpui2::RenderOnce

source ·
pub trait RenderOnce: Sized {
    type Element: Element + 'static;

    // Required methods
    fn element_id(&self) -> Option<ElementId>;
    fn render_once(self) -> Self::Element;

    // Provided methods
    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
    ) -> R
       where T: Clone + Default + Debug + Into<AvailableSpace> { ... }
    fn map<U>(self, f: impl FnOnce(Self) -> U) -> U
       where Self: Sized,
             U: RenderOnce { ... }
    fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
       where Self: Sized { ... }
    fn when_some<T>(
        self,
        option: Option<T>,
        then: impl FnOnce(Self, T) -> Self
    ) -> Self
       where Self: Sized { ... }
}

Required Associated Types§

source

type Element: Element + 'static

Required Methods§

Provided Methods§

source

fn render_into_any(self) -> AnyElement

source

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>,

source

fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,

source

fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,

source

fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,

Implementations on Foreign Types§

source§

impl RenderOnce for &'static str

§

type Element = &'static str

source§

fn element_id(&self) -> Option<ElementId>

source§

fn render_once(self) -> Self::Element

Implementors§