pub struct TimeEntry {
pub id: EntryId,
pub project_id: ProjectId,
pub session_id: Option<SessionId>,
pub start: OffsetDateTime,
pub end: Option<OffsetDateTime>,
pub duration_secs: Option<i64>,
pub source: EntrySource,
pub notes: Option<String>,
pub tags: Vec<String>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
}Expand description
A single time tracking entry.
Fields§
§id: EntryIdUnique identifier.
project_id: ProjectIdThe project this entry belongs to.
session_id: Option<SessionId>The shell session that created this entry (None for manual/retroactive).
start: OffsetDateTimeWhen tracking started.
end: Option<OffsetDateTime>When tracking stopped (None means currently running).
duration_secs: Option<i64>Duration in seconds. Computed on stop, or set directly for stint add.
source: EntrySourceHow this entry was created.
notes: Option<String>Optional notes.
User-defined tags.
created_at: OffsetDateTimeWhen this entry was created.
updated_at: OffsetDateTimeWhen this entry was last updated.
Implementations§
Source§impl TimeEntry
impl TimeEntry
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true if this entry is currently running (no end time).
Sourcepub fn computed_duration_secs(&self) -> Option<i64>
pub fn computed_duration_secs(&self) -> Option<i64>
Computes the duration from start and end timestamps.
Returns duration_secs if set, otherwise computes from end - start.
Returns None if the entry is still running and has no explicit duration.
Trait Implementations§
impl StructuralPartialEq for TimeEntry
Auto Trait Implementations§
impl Freeze for TimeEntry
impl RefUnwindSafe for TimeEntry
impl Send for TimeEntry
impl Sync for TimeEntry
impl Unpin for TimeEntry
impl UnsafeUnpin for TimeEntry
impl UnwindSafe for TimeEntry
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