Work session tracking for time and activity logging
| Tier | domain |
| Role | unclassified (baselined) |
| Path | crates/domain/worklog |
| Edition | 2021 |
| Targets | domain_worklog |
| Public items | 52 across 0 modules |
| Tests | 33 |
What it is for
Work session tracking library crates for time and activity logging.
This crate provides:
WorkSession- A tracked work sessionTimeEntry- Individual time entriesSessionStatus- Active, Paused, Completed states
Capabilities
Break
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub struct Break |
Break :: fn new() -> Self |
Break :: fn with_reason(mut self, reason : impl Into <String>) -> Self |
Break :: fn end(& mut self) |
Break :: fn duration(& self) -> Duration |
Break :: fn is_ongoing(& self) -> bool |
Break :: fn default() -> Self |
Break :: fn id(& self) -> Uuid |
Result
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub type Result<T>: std::result::Result <T, WorklogError> |
SessionStatus
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub enum SessionStatus |
SessionStatus :: fn is_final(& self) -> bool |
SessionStatus :: fn can_resume(& self) -> bool |
SessionStatus :: fn can_pause(& self) -> bool |
SessionStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
SessionStatus :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err> |
TimeEntry:TimeEntry
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub struct TimeEntry |
TimeEntry:billable
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn billable(mut self, is_billable : bool) -> Self |
TimeEntry:created
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn created_at(& self) -> DateTime <Utc> |
TimeEntry:deleted
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn deleted_at(& self) -> Option <DateTime <Utc>> |
TimeEntry:duration
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn duration(& self) -> Duration |
TimeEntry:for
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn for_project(mut self, project_id : Uuid) -> Self |
TimeEntry:id
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn id(& self) -> Uuid |
TimeEntry:new
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn new(user_id : Uuid, start_time : DateTime <Utc>, end_time : DateTime <Utc>) -> Self |
TimeEntry:overlaps
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn overlaps_with(& self, other : & TimeEntry) -> bool |
TimeEntry:updated
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn updated_at(& self) -> DateTime <Utc> |
TimeEntry:with
Work session tracking library crates for time and activity logging.
| Item |
|---|
TimeEntry :: fn with_task(mut self, task_reference : impl Into <String>) -> Self |
TimeEntry :: fn with_description(mut self, description : impl Into <String>) -> Self |
TimeEntry :: fn with_tag(mut self, tag : impl Into <String>) -> Self |
WorkSession:WorkSession
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub struct WorkSession |
WorkSession:billable
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn billable(mut self, is_billable : bool) -> Self |
WorkSession:break
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn break_count(& self) -> usize |
WorkSession:cancel
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn cancel(& mut self) -> Result <()> |
WorkSession:complete
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn complete(& mut self) -> Result <()> |
WorkSession:created
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn created_at(& self) -> DateTime <Utc> |
WorkSession:deleted
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn deleted_at(& self) -> Option <DateTime <Utc>> |
WorkSession:for
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn for_project(mut self, project_id : Uuid) -> Self |
WorkSession:gross
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn gross_duration(& self) -> Duration |
WorkSession:id
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn id(& self) -> Uuid |
WorkSession:is
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn is_active(& self) -> bool |
WorkSession :: fn is_paused(& self) -> bool |
WorkSession:net
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn net_duration(& self) -> Duration |
WorkSession:pause
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn pause(& mut self) -> Result <()> |
WorkSession :: fn pause_with_reason(& mut self, reason : impl Into <String>) -> Result <()> |
WorkSession:resume
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn resume(& mut self) -> Result <()> |
WorkSession:set
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn set_notes(& mut self, notes : impl Into <String>) |
WorkSession:start
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn start(user_id : Uuid) -> Self |
WorkSession:total
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn total_break_duration(& self) -> Duration |
WorkSession:updated
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn updated_at(& self) -> DateTime <Utc> |
WorkSession:with
Work session tracking library crates for time and activity logging.
| Item |
|---|
WorkSession :: fn with_task(mut self, task_reference : impl Into <String>) -> Self |
WorkSession :: fn with_description(mut self, description : impl Into <String>) -> Self |
WorkSession :: fn with_tag(mut self, tag : impl Into <String>) -> Self |
WorklogError
Work session tracking library crates for time and activity logging.
| Item |
|---|
pub enum WorklogError |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
No public modules: the crate root is its whole surface.
Public surface
`crate root`
| Item | What it is |
|---|---|
pub enum WorklogError | Errors that can occur in worklog operations. |
pub type Result<T>: std::result::Result <T, WorklogError> | Result type for worklog operations. |
pub enum SessionStatus | Status of a work session. |
SessionStatus :: fn is_final(& self) -> bool | Returns true if the session is in a final state. |
SessionStatus :: fn can_resume(& self) -> bool | Returns true if the session can be resumed. |
SessionStatus :: fn can_pause(& self) -> bool | Returns true if the session can be paused. |
SessionStatus :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
SessionStatus :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err> | — |
pub struct Break | A break or pause in a work session. |
Break :: fn new() -> Self | Creates a new break starting now. |
Break :: fn with_reason(mut self, reason : impl Into <String>) -> Self | Sets the reason for the break. |
Break :: fn end(& mut self) | Ends the break. |
Break :: fn duration(& self) -> Duration | Returns the duration of the break. |
Break :: fn is_ongoing(& self) -> bool | Returns true if the break is ongoing. |
Break :: fn default() -> Self | — |
Break :: fn id(& self) -> Uuid | — |
pub struct WorkSession | A work session. |
WorkSession :: fn start(user_id : Uuid) -> Self | Creates a new active work session. |
WorkSession :: fn for_project(mut self, project_id : Uuid) -> Self | Sets the project ID. |
WorkSession :: fn with_task(mut self, task_reference : impl Into <String>) -> Self | Sets the task reference. |
WorkSession :: fn with_description(mut self, description : impl Into <String>) -> Self | Sets the description. |
WorkSession :: fn with_tag(mut self, tag : impl Into <String>) -> Self | Adds a tag. |
WorkSession :: fn billable(mut self, is_billable : bool) -> Self | Sets billable status. |
WorkSession :: fn pause(& mut self) -> Result <()> | Pauses the session |
WorkSession :: fn pause_with_reason(& mut self, reason : impl Into <String>) -> Result <()> | Pauses with a reason |
WorkSession :: fn resume(& mut self) -> Result <()> | Resumes the session |
WorkSession :: fn complete(& mut self) -> Result <()> | Completes the session |
WorkSession :: fn cancel(& mut self) -> Result <()> | Cancels the session |
WorkSession :: fn set_notes(& mut self, notes : impl Into <String>) | Sets notes. |
WorkSession :: fn total_break_duration(& self) -> Duration | Returns the total break duration. |
WorkSession :: fn gross_duration(& self) -> Duration | Returns the gross duration (including breaks). |
WorkSession :: fn net_duration(& self) -> Duration | Returns the net duration (excluding breaks). |
WorkSession :: fn is_active(& self) -> bool | Returns true if the session is currently active. |
WorkSession :: fn is_paused(& self) -> bool | Returns true if the session is paused. |
WorkSession :: fn break_count(& self) -> usize | Returns the number of breaks taken. |
WorkSession :: fn id(& self) -> Uuid | — |
WorkSession :: fn created_at(& self) -> DateTime <Utc> | — |
WorkSession :: fn updated_at(& self) -> DateTime <Utc> | — |
WorkSession :: fn deleted_at(& self) -> Option <DateTime <Utc>> | — |
pub struct TimeEntry | A time entry (manual time log). |
TimeEntry :: fn new(user_id : Uuid, start_time : DateTime <Utc>, end_time : DateTime <Utc>) -> Self | Creates a new time entry. |
TimeEntry :: fn for_project(mut self, project_id : Uuid) -> Self | Sets the project ID. |
TimeEntry :: fn with_task(mut self, task_reference : impl Into <String>) -> Self | Sets the task reference. |
TimeEntry :: fn with_description(mut self, description : impl Into <String>) -> Self | Sets the description. |
TimeEntry :: fn with_tag(mut self, tag : impl Into <String>) -> Self | Adds a tag. |
TimeEntry :: fn billable(mut self, is_billable : bool) -> Self | Sets billable status. |
TimeEntry :: fn duration(& self) -> Duration | Returns the duration. |
TimeEntry :: fn overlaps_with(& self, other : & TimeEntry) -> bool | Checks if this entry overlaps with another. |
TimeEntry :: fn id(& self) -> Uuid | — |
TimeEntry :: fn created_at(& self) -> DateTime <Utc> | — |
TimeEntry :: fn updated_at(& self) -> DateTime <Utc> | — |
TimeEntry :: fn deleted_at(& self) -> Option <DateTime <Utc>> | — |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into foundation.
Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | domain |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/domain/worklog |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_domain["domain"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio-test | ^0.4 | — | no | always |
Build. None.
Depended on by. 1 workspace crate.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_worklog["application-worklog"] -->|uses| SELF SELF["domain-worklog"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | domain_worklog | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
WorklogError | Result |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
1 workspace crate depends on this one: application-worklog.
Verification
| Kind | Count |
|---|---|
| Unit tests | 33 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 6 | 0 | 1 |
What the tests establish, by name:
test_break_duration—src/lib.rstest_break_end—src/lib.rstest_break_new—src/lib.rstest_break_serialization—src/lib.rstest_break_with_reason—src/lib.rstest_session_status_can_pause—src/lib.rstest_session_status_can_resume—src/lib.rstest_session_status_display—src/lib.rstest_session_status_from_str—src/lib.rstest_session_status_is_final—src/lib.rstest_time_entry_duration—src/lib.rstest_time_entry_for_project—src/lib.rstest_time_entry_new—src/lib.rstest_time_entry_overlaps—src/lib.rstest_time_entry_serialization—src/lib.rstest_time_entry_with_task—src/lib.rstest_work_session_billable—src/lib.rstest_work_session_cancel—src/lib.rstest_work_session_cannot_complete_twice—src/lib.rstest_work_session_complete—src/lib.rstest_work_session_complete_while_paused—src/lib.rstest_work_session_durations—src/lib.rstest_work_session_for_project—src/lib.rstest_work_session_pause—src/lib.rstest_work_session_pause_with_reason—src/lib.rstest_work_session_resume—src/lib.rstest_work_session_serialization—src/lib.rstest_work_session_set_notes—src/lib.rstest_work_session_start—src/lib.rstest_work_session_total_break_duration—src/lib.rs- _… 3 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 40 | 52 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 40
"No rustdoc detected" : 12
Metrics
| Metric | Value |
|---|---|
| Rust source files | 1 |
| Source lines | 873 |
| Code lines | 627 |
| Public API items | 52 |
| Public modules | 0 |
| Tests | 33 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"enum" : 2
"method" : 46
"struct" : 3
"type alias" : 1
pie showData
title Rust source composition
"Code" : 627
"Blank or comment" : 246
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.