Skip to main content

ActivityHost

Trait ActivityHost 

Source
pub trait ActivityHost: 'static {
    type View;
    type Effect;
    type Subscription;
    type Message: Clone + Debug + Send + Sync;
}
Expand description

Activity 宿主环境定义。

充当 UI 框架与核心调度器之间的桥梁。接入方需要定义一个空结构体并实现该 Trait, 以指定具体的视图、副作用、订阅和消息类型。

Required Associated Types§

Source

type View

视图类型 (例如 Dioxus/Iced 的 Element)

Source

type Effect

副作用/异步任务类型 (例如 Iced 的 Task/Command)

Source

type Subscription

订阅类型 (如定时器、全局快捷键等)

Source

type Message: Clone + Debug + Send + Sync

全局应用消息类型

Implementors§