//! Toggle persistent state.
/// Persistent state for a toggle widget.
////// The `toggled` flag is the only persistent bit; everything else
/// is per-frame in `ToggleView`.
#[derive(Debug, Default, Clone)]pubstructToggleState{/// Whether the toggle is currently ON.
pubtoggled:bool,
}implToggleState{/// Flip the toggle value and return the new state.
pubfnflip(&mutself)->bool{self.toggled =!self.toggled;self.toggled
}}