pub struct FormattedEvent {
pub id: i32,
pub start: String,
pub end: String,
pub duration: String,
}Expand description
Represents a formatted time-based event for display purposes.
§Examples
use kasl::libs::formatter::FormattedEvent;
// Work interval representation
let interval = FormattedEvent {
id: 1,
start: "09:00".to_string(),
end: "12:00".to_string(),
duration: "03:00".to_string(),
};
// Pause representation
let pause = FormattedEvent {
id: 2,
start: "12:00".to_string(),
end: "12:30".to_string(),
duration: "00:30".to_string(),
};Fields§
§id: i32The sequential identifier of the event.
Used for ordering events chronologically and providing reference numbers in display tables. Typically starts from 1 and increments for each event in a sequence.
start: StringThe formatted start time (e.g., “09:00”, “14:30”).
Represents when the event began, typically formatted as “HH:MM” in 24-hour format. For work intervals, this is when work started. For pauses, this is when the break began.
end: StringThe formatted end time (e.g., “17:00”, “15:15”).
Represents when the event ended, typically formatted as “HH:MM” in 24-hour format. May be “-” or empty if the event is ongoing or has no defined end time.
duration: StringThe formatted duration (e.g., “08:00”, “00:45”).
Represents the total length of the event, formatted as “HH:MM”. This is calculated from the difference between start and end times. May be “–:–” if the duration cannot be determined.
Trait Implementations§
Source§impl Clone for FormattedEvent
impl Clone for FormattedEvent
Source§fn clone(&self) -> FormattedEvent
fn clone(&self) -> FormattedEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more