# Add a derive macro for Element · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/bede668b14e66f591ca2928b18d398d800e68a4e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: bede668b14e66f591ca2928b18d398d800e68a4e

Requested commit: bede668b14e66f591ca2928b18d398d800e68a4e

Commit: bede668b14e66f591ca2928b18d398d800e68a4e

Tree: f0dad640bb0517626885a28ea65688e4e52654fc

Author: Nathan Sobo

Committer: Nathan Sobo

## Message

```
Add a derive macro for Element

To turn any struct into a composite element, you can implement a render method
with the following signature:

fn render<V: View>(&mut self, view: &mut V, cx: &mut ViewContext<V>) -> AnyElement<V>;

Then add #[derive(Element)] to the struct definition.

This will make it easier to introduce higher-level components that are expressed in
terms of other elements.

```

## Parents

- [82bd5fb56405eb782f2ebb9658f72ca962f52b9a](https://git.cafe/gitcafe/zed/commit/82bd5fb56405eb782f2ebb9658f72ca962f52b9a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/bede668b14e66f591ca2928b18d398d800e68a4e?format=markdown)
