async_ui_core 0.1.0

Shared code for Async UI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{future::Future, rc::Rc};

use scoped_tls::ScopedKey;

use crate::vnode::VNode;

pub trait BackendTrait: 'static + Sized {
    type Node: 'static;
    fn add_child_node(
        parent: &mut Self::Node,
        child: &mut Self::Node,
        insert_before_sibling: Option<&Self::Node>,
    );
    fn del_child_node(parent: &mut Self::Node, child: &mut Self::Node);
    fn drive_executor<F: Future<Output = ()> + 'static>(fut: F);
    fn initialize();
    fn get_vnode_key() -> &'static ScopedKey<Rc<VNode<Self>>>;
}