Skip to main content

Update

Trait Update 

Source
pub trait Update {
    // Required methods
    fn add(
        &mut self,
        controller: ControllerId,
        resource: Resource,
    ) -> Option<Resource>;
    fn remove(
        &mut self,
        controller: ControllerId,
        resource: &ResourceId,
    ) -> Option<Resource>;
}
Expand description

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

Required Methods§

Source

fn add( &mut self, controller: ControllerId, resource: Resource, ) -> Option<Resource>

Add the resource to the specified controller’s state.

Optionally returns a resource that has already been added to the controller with the same ResourceId.

Source

fn remove( &mut self, controller: ControllerId, resource: &ResourceId, ) -> Option<Resource>

Remove the resource from the specified controller’s state.

Returns the removed resource, if present.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Update for HashMap<ControllerId, HashMap<ResourceId, Resource>>

Source§

fn add( &mut self, controller: ControllerId, resource: Resource, ) -> Option<Resource>

Source§

fn remove( &mut self, controller: ControllerId, resource: &ResourceId, ) -> Option<Resource>

Implementors§