Repository navigation
Replies: 1 comment 3 replies
|
In impl Application for Arc {
type Executor = executor::Default;
type Message = Message;
type Theme = Theme;
type Flags = ();
fn new(_flags: ()) -> (Self, Command<Message>) {
(
Arc {
start: Instant::now(),
cache: Default::default(),
},
Command::none(),
)
}
fn title(&self) -> String {
String::from("Arc - Iced")
}
fn update(&mut self, _: Message) -> Command<Message> {
self.cache.clear();
Command::none()
}
fn view(&self) -> Element<Message> {
Canvas::new(self)
.width(Length::Fill)
.height(Length::Fill)
.into()
}
fn theme(&self) -> Theme {
Theme::Dark
}
fn subscription(&self) -> Subscription<Message> {
iced::time::every(std::time::Duration::from_millis(10))
.map(|_| Message::Tick)
}
}could we use sandbox to reduce it? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
could just :
in
impl Application for T; T:Sandboxand
in
SandboxAll reactions