mangui/rusalka/src/component.rs
2023-10-28 02:35:58 +02:00

12 lines
No EOL
356 B
Rust

use mangui::SharedNode;
/// A rusalka component
pub trait Component {
type ComponentAttrs;
fn new(attr: Self::ComponentAttrs) -> Self;
fn get(&self) -> &Self::ComponentAttrs;
fn set(&mut self, attr: Self::ComponentAttrs);
fn mount(&self, parent: &SharedNode, before: Option<&SharedNode>);
fn update(&self);
fn unmount(&self);
}