relm4/component/sync/
mod.rs

1// Copyright 2021-2022 Aaron Erhardt <aaron.erhardt@t-online.de>
2// Copyright 2022 System76 <info@system76.com>
3// SPDX-License-Identifier: MIT or Apache-2.0
4
5mod builder;
6mod connector;
7mod controller;
8mod state_watcher;
9mod stream;
10mod traits;
11
12pub use builder::ComponentBuilder;
13pub use connector::Connector;
14pub use controller::{ComponentController, Controller};
15pub use state_watcher::StateWatcher;
16pub use stream::ComponentStream;
17pub use traits::{Component, SimpleComponent};
18
19use std::future::Future;
20use std::pin::Pin;
21
22/// A future returned by a component's command method.
23pub type CommandFuture = Pin<Box<dyn Future<Output = ()> + Send>>;
24
25/// Contains the initial model and widgets being docked into a component.
26#[derive(Debug)]
27pub struct ComponentParts<C: Component> {
28    /// The model of the component.
29    pub model: C,
30    /// The widgets created for the view.
31    pub widgets: C::Widgets,
32}