rsproject/Relm4-0.6.2/relm4-macros/tests/redundant_clone.rs
2024-03-02 00:19:08 +08:00

40 lines
774 B
Rust

use relm4::{
component::{AsyncComponent, AsyncComponentParts, AsyncComponentSender},
gtk,
};
struct App;
#[relm4::component(pub async)]
impl AsyncComponent for App {
type Init = ();
type Input = ();
type Output = ();
type CommandOutput = ();
view! {
gtk::Window {}
}
// Initialize the component.
async fn init(
_init: Self::Init,
root: Self::Root,
_sender: AsyncComponentSender<Self>,
) -> AsyncComponentParts<Self> {
let model = Self;
let widgets = view_output!();
AsyncComponentParts { model, widgets }
}
async fn update(
&mut self,
_msg: Self::Input,
_sender: AsyncComponentSender<Self>,
_root: &Self::Root,
) {
}
}