Skip to main content

topcoat_view/
component.rs

1use topcoat_core::{context::Cx, error::Error};
2
3use crate::{Props, View};
4
5pub trait Component {
6    type Props: Props;
7
8    #[must_use]
9    fn props_builder() -> <Self::Props as Props>::Builder {
10        Self::Props::builder()
11    }
12
13    fn render(
14        self,
15        cx: &Cx,
16        props: Self::Props,
17    ) -> impl Future<Output = Result<View, Error>> + Send;
18}