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 { ... }
}