pub trait Toggleable {
// Required methods
fn is_activated(&self) -> bool;
fn mark_activated(&mut self);
fn mark_deactivated(&mut self);
// Provided method
fn is_deactivated(&self) -> bool { ... }
}Expand description
This trait marks items as being able to toggle on and off. The motivation for this is CRDT items which want to stay in a list even after they’ve been deleted.
Required Methods§
fn is_activated(&self) -> bool
fn mark_activated(&mut self)
fn mark_deactivated(&mut self)
Provided Methods§
fn is_deactivated(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".