pub struct ToggleState {
pub caption: String,
pub active: bool,
pub last_toggle: Option<Timestamp>,
}Fields§
§caption: String§active: bool§last_toggle: Option<Timestamp>Implementations§
Source§impl ToggleState
impl ToggleState
pub fn new(caption: String, active: bool) -> Self
pub fn toggle_action(&self) -> ToggleAction
Trait Implementations§
Source§impl Clone for ToggleState
impl Clone for ToggleState
Source§fn clone(&self) -> ToggleState
fn clone(&self) -> ToggleState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToggleState
impl Debug for ToggleState
Source§impl<'de> Deserialize<'de> for ToggleState
impl<'de> Deserialize<'de> for ToggleState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Flow for ToggleState
impl Flow for ToggleState
Source§type Action = ToggleAction
type Action = ToggleAction
ControlEvent - that send from a client to a serverSource§type Event = ToggleEvent
type Event = ToggleEvent
UpdateEvent - that sent from a server to a clientfn stream_type() -> StreamType
fn apply(&mut self, event: TimedEvent<Self::Event>)
fn pack_state(&self) -> Result<PackedState, Error>
fn unpack_state(data: &PackedState) -> Result<Self, Error>
fn pack_event(delta: &TimedEvent<Self::Event>) -> Result<PackedEvent, Error>
fn unpack_event(data: &PackedEvent) -> Result<TimedEvent<Self::Event>, Error>
fn pack_action(action: &Self::Action) -> Result<PackedAction, Error>
fn unpack_action(data: &PackedAction) -> Result<Self::Action, Error>
Auto Trait Implementations§
impl Freeze for ToggleState
impl RefUnwindSafe for ToggleState
impl Send for ToggleState
impl Sync for ToggleState
impl Unpin for ToggleState
impl UnwindSafe for ToggleState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more