Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add some docs

Nathan Soboc636731fd9a8
diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs
index 4ec4ed35505..30456f14a7f 100644
--- a/crates/gpui2/src/element.rs
+++ b/crates/gpui2/src/element.rs
@@ -6,6 +6,10 @@ use derive_more::{Deref, DerefMut};
pub(crate) use smallvec::SmallVec;
use std::{any::Any, fmt::Debug};
+/// Implemented by types that participate in laying out and painting the contents of a window.
+/// Elements form a tree and are laid out according to web-based layout rules.
+/// Rather than calling methods on implementers of this trait directly, you'll usually call `into_any` to convert them into an AnyElement, which manages state internally.
+/// You can create custom elements by implementing this trait.
pub trait Element: 'static + IntoElement {
type State: 'static;