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§
Sourcefn add(
&mut self,
controller: ControllerId,
resource: Resource,
) -> Option<Resource>
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
.
Sourcefn remove(
&mut self,
controller: ControllerId,
resource: &ResourceId,
) -> Option<Resource>
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.