pub struct TimeAxis {
pub start: TimePoint,
pub end: TimePoint,
pub scale: TimeScale,
pub tick_width: f32,
}Expand description
The stretch of time a Scheduler shows, how wide it is and how it is marked.
Fields§
§start: TimePointWhere it begins.
end: TimePointWhere it ends.
scale: TimeScaleWhat a tick is.
tick_width: f32The width of a tick, in logical pixels. A month is 30 days wide, so all time runs at one speed.
Implementations§
Source§impl TimeAxis
impl TimeAxis
Sourcepub fn weeks(from: Date, count: u32) -> Self
pub fn weeks(from: Date, count: u32) -> Self
count weeks from the week of from, a tick per week.
Sourcepub fn months(from: Date, count: u32) -> Self
pub fn months(from: Date, count: u32) -> Self
count months from the month of from, a tick per month.
Sourcepub fn zoomed_in(&self) -> Option<Self>
pub fn zoomed_in(&self) -> Option<Self>
The same stretch of time, one step nearer. None when it cannot go nearer.
Sourcepub fn zoomed_out(&self) -> Option<Self>
pub fn zoomed_out(&self) -> Option<Self>
The same stretch of time, one step farther. None when it cannot go farther.
Sourcepub fn shifted(&self, steps: i64) -> Self
pub fn shifted(&self, steps: i64) -> Self
The same length of time, moved by a whole steps of its length.
Sourcepub fn x_of(&self, time: TimePoint) -> f32
pub fn x_of(&self, time: TimePoint) -> f32
Where a moment falls, in logical pixels from the start.
Sourcepub fn snap_minutes(&self) -> i64
pub fn snap_minutes(&self) -> i64
The smallest step an event moves by: a quarter of an hour on the hour scale, a day on the others.
Trait Implementations§
impl Copy for TimeAxis
impl StructuralPartialEq for TimeAxis
Auto Trait Implementations§
impl Freeze for TimeAxis
impl RefUnwindSafe for TimeAxis
impl Send for TimeAxis
impl Sync for TimeAxis
impl Unpin for TimeAxis
impl UnsafeUnpin for TimeAxis
impl UnwindSafe for TimeAxis
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