Skip to content
Discussion options

You must be logged in to vote

This is because of the GPUI IntoElement design.

In GPUI, the element that impl IntoElement are use RenderOnce, and you can see the render method of this, the self is designed with will take ownership.

Followhing this design, all elements of IntoElement (We call it Stateless) does not implement Clone. Because we couldn't, there may have some not clonable members in it, for example a children used Div, the Div is not clonable.

struct Button {
  children: Vec<Div>
}

You may see the Icon element, it is an IntoElement, but it is clonable. This just a special one, the clone is very special.

impl Clone for Icon {
fn

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Moulberry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1615 on November 17, 2025 02:02.