pub enum TimelineMessage {
AddEvent(TimelineEvent),
AddSpan(TimelineSpan),
SetEvents(Vec<TimelineEvent>),
SetSpans(Vec<TimelineSpan>),
Clear,
ZoomIn,
ZoomOut,
PanLeft,
PanRight,
FitAll,
SelectNext,
SelectPrev,
}Expand description
Messages that can be sent to a Timeline.
§Example
use envision::component::{
Component, Timeline, TimelineState, TimelineMessage, TimelineEvent,
};
let mut state = TimelineState::new();
let event = TimelineEvent::new("e1", 100.0, "Start");
state.update(TimelineMessage::AddEvent(event));
assert_eq!(state.events().len(), 1);Variants§
AddEvent(TimelineEvent)
Add a point event.
AddSpan(TimelineSpan)
Add a duration span.
SetEvents(Vec<TimelineEvent>)
Replace all events.
SetSpans(Vec<TimelineSpan>)
Replace all spans.
Clear
Clear everything.
ZoomIn
Narrow the visible window (zoom in).
ZoomOut
Widen the visible window (zoom out).
PanLeft
Shift visible window left.
PanRight
Shift visible window right.
FitAll
Adjust view to show all events/spans.
SelectNext
Select next event/span.
SelectPrev
Select previous event/span.
Trait Implementations§
Source§impl Clone for TimelineMessage
impl Clone for TimelineMessage
Source§fn clone(&self) -> TimelineMessage
fn clone(&self) -> TimelineMessage
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 TimelineMessage
impl Debug for TimelineMessage
Source§impl<'de> Deserialize<'de> for TimelineMessage
impl<'de> Deserialize<'de> for TimelineMessage
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 PartialEq for TimelineMessage
impl PartialEq for TimelineMessage
Source§impl Serialize for TimelineMessage
impl Serialize for TimelineMessage
impl StructuralPartialEq for TimelineMessage
Auto Trait Implementations§
impl Freeze for TimelineMessage
impl RefUnwindSafe for TimelineMessage
impl Send for TimelineMessage
impl Sync for TimelineMessage
impl Unpin for TimelineMessage
impl UnsafeUnpin for TimelineMessage
impl UnwindSafe for TimelineMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more