Trait ObjectModel

Source
pub trait ObjectModel {
    type Node;

    // Required methods
    fn create(
        &mut self,
        node: &Arc<Self::Node>,
        parent: &Arc<Self::Node>,
        sibling: &Option<Arc<Self::Node>>,
    );
    fn remove(&mut self, node: &Arc<Self::Node>, parent: &Arc<Self::Node>);
    fn update(&mut self, node: &Arc<Self::Node>, next: &Arc<Self::Node>);

    // Provided methods
    fn start(&mut self) -> impl Future<Output = ()> + Send { ... }
    fn finalize(&mut self) -> impl Future<Output = ()> + Send { ... }
    fn subscribe(&mut self, _signal: Sender<()>) { ... }
    fn get_context(
        &mut self,
    ) -> Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>> { ... }
    fn set_context(
        &mut self,
        _ctx: Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn create( &mut self, node: &Arc<Self::Node>, parent: &Arc<Self::Node>, sibling: &Option<Arc<Self::Node>>, )

Source

fn remove(&mut self, node: &Arc<Self::Node>, parent: &Arc<Self::Node>)

Source

fn update(&mut self, node: &Arc<Self::Node>, next: &Arc<Self::Node>)

Provided Methods§

Source

fn start(&mut self) -> impl Future<Output = ()> + Send

Source

fn finalize(&mut self) -> impl Future<Output = ()> + Send

Source

fn subscribe(&mut self, _signal: Sender<()>)

Source

fn get_context(&mut self) -> Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>

Source

fn set_context( &mut self, _ctx: Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§