Skip to main content

Update

Trait Update 

Source
pub trait Update<S> {
    type Interest: FieldInterests;

    // Required method
    fn update(
        &mut self,
        event: EventWithInterest<Self::Interest>,
    ) -> Result<UpdateResult<'_, S, Self::Interest>, UpdateError>;
}
Expand description

A trait for types holding interface state that can be updated by change events.

Required Associated Types§

Source

type Interest: FieldInterests

The expected watcher interest type for this update target.

Required Methods§

Source

fn update( &mut self, event: EventWithInterest<Self::Interest>, ) -> Result<UpdateResult<'_, S, Self::Interest>, UpdateError>

Update state with the interface change event.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, S, I> Update<S> for BTreeMap<K, PropertiesAndState<S, I>>

Source§

type Interest = I

Source§

fn update( &mut self, event: EventWithInterest<I>, ) -> Result<UpdateResult<'_, S, I>, UpdateError>

Source§

impl<K, S, I> Update<S> for HashMap<K, PropertiesAndState<S, I>>

Source§

type Interest = I

Source§

fn update( &mut self, event: EventWithInterest<I>, ) -> Result<UpdateResult<'_, S, I>, UpdateError>

Implementors§