Encounters: stateful visits, sessions, and interactions
| Tier | domain |
| Role | unclassified (baselined) |
| Path | crates/domain/encounters |
| Edition | 2021 |
| Targets | domain_encounters |
| Public items | 39 across 0 modules |
| Tests | 29 |
What it is for
Encounter library crates: stateful visits, sessions, and interactions.
This crate provides:
Encounter- A stateful visit or sessionEncounterState- Lifecycle states (Scheduled, Active, Completed, etc.)EncounterType- Types of encounters (Visit, Call, Meeting, etc.)
Capabilities
Encounter:Encounter
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub struct Encounter |
Encounter:add
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn add_participant(& mut self, participant : Participant) |
Encounter:at
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn at_location(mut self, location : impl Into <String>) -> Self |
Encounter:cancel
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn cancel(& mut self) -> Result <()> |
Encounter:complete
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn complete(& mut self) -> Result <()> |
Encounter:created
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn created_at(& self) -> DateTime <Utc> |
Encounter:deleted
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn deleted_at(& self) -> Option <DateTime <Utc>> |
Encounter:duration
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn duration(& self) -> Option <Duration> |
Encounter:id
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn id(& self) -> Uuid |
Encounter:is
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn is_active(& self) -> bool |
Encounter:mark
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn mark_no_show(& mut self) -> Result <()> |
Encounter:new
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn new(encounter_type : EncounterType, title : impl Into <String>) -> Self |
Encounter:participant
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn participant_count(& self) -> usize |
Encounter:pause
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn pause(& mut self) -> Result <()> |
Encounter:present
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn present_participants(& self) -> Vec <& Participant> |
Encounter:resume
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn resume(& mut self) -> Result <()> |
Encounter:scheduled
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn scheduled_for(mut self, start : DateTime <Utc>, end : DateTime <Utc>) -> Self |
Encounter:set
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn set_notes(& mut self, notes : impl Into <String>) |
Encounter:start
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn start(& mut self) -> Result <()> |
Encounter:updated
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn updated_at(& self) -> DateTime <Utc> |
Encounter:with
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
Encounter :: fn with_description(mut self, description : impl Into <String>) -> Self |
EncounterError
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub enum EncounterError |
EncounterState
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub enum EncounterState |
EncounterState :: fn is_final(& self) -> bool |
EncounterState :: fn can_start(& self) -> bool |
EncounterState :: fn can_pause(& self) -> bool |
EncounterState :: fn can_complete(& self) -> bool |
EncounterState :: fn can_cancel(& self) -> bool |
EncounterState :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
EncounterState :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err> |
EncounterType
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub enum EncounterType |
EncounterType :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
Participant
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub struct Participant |
Participant :: fn new(party_id : PartyId, role : impl Into <String>) -> Self |
Participant :: fn join(& mut self) |
Participant :: fn leave(& mut self) |
Participant :: fn is_present(& self) -> bool |
Participant :: fn id(& self) -> Uuid |
Result
Encounter library crates: stateful visits, sessions, and interactions.
| Item |
|---|
pub type Result<T>: std::result::Result <T, EncounterError> |
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 EncounterError | Errors that can occur in encounter operations. |
pub type Result<T>: std::result::Result <T, EncounterError> | Result type for encounter operations. |
pub enum EncounterState | State of an encounter. |
EncounterState :: fn is_final(& self) -> bool | Returns true if the encounter is in a final state. |
EncounterState :: fn can_start(& self) -> bool | Returns true if the encounter can be started. |
EncounterState :: fn can_pause(& self) -> bool | Returns true if the encounter can be paused. |
EncounterState :: fn can_complete(& self) -> bool | Returns true if the encounter can be completed. |
EncounterState :: fn can_cancel(& self) -> bool | Returns true if the encounter can be cancelled. |
EncounterState :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
EncounterState :: fn from_str(s : & str) -> std::result::Result <Self, Self::Err> | — |
pub enum EncounterType | Type of encounter. |
EncounterType :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub struct Participant | A participant in an encounter. |
Participant :: fn new(party_id : PartyId, role : impl Into <String>) -> Self | Creates a new participant. |
Participant :: fn join(& mut self) | Records when the participant joined. |
Participant :: fn leave(& mut self) | Records when the participant left. |
Participant :: fn is_present(& self) -> bool | Returns true if the participant is currently present. |
Participant :: fn id(& self) -> Uuid | — |
pub struct Encounter | An encounter (visit, session, or interaction). |
Encounter :: fn new(encounter_type : EncounterType, title : impl Into <String>) -> Self | Creates a new encounter. |
Encounter :: fn with_description(mut self, description : impl Into <String>) -> Self | Sets the description. |
Encounter :: fn scheduled_for(mut self, start : DateTime <Utc>, end : DateTime <Utc>) -> Self | Sets the scheduled times. |
Encounter :: fn at_location(mut self, location : impl Into <String>) -> Self | Sets the location. |
Encounter :: fn add_participant(& mut self, participant : Participant) | Adds a participant. |
Encounter :: fn start(& mut self) -> Result <()> | Starts the encounter |
Encounter :: fn pause(& mut self) -> Result <()> | Pauses the encounter |
Encounter :: fn resume(& mut self) -> Result <()> | Resumes a paused encounter |
Encounter :: fn complete(& mut self) -> Result <()> | Completes the encounter |
Encounter :: fn cancel(& mut self) -> Result <()> | Cancels the encounter |
Encounter :: fn mark_no_show(& mut self) -> Result <()> | Marks as no-show |
Encounter :: fn set_notes(& mut self, notes : impl Into <String>) | Sets notes. |
Encounter :: fn duration(& self) -> Option <Duration> | Returns the duration if started and ended. |
Encounter :: fn is_active(& self) -> bool | Returns true if the encounter is currently active. |
Encounter :: fn participant_count(& self) -> usize | Returns the number of participants. |
Encounter :: fn present_participants(& self) -> Vec <& Participant> | Returns participants currently present. |
Encounter :: fn id(& self) -> Uuid | — |
Encounter :: fn created_at(& self) -> DateTime <Utc> | — |
Encounter :: fn updated_at(& self) -> DateTime <Utc> | — |
Encounter :: fn deleted_at(& self) -> Option <DateTime <Utc>> | — |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into foundation, identity.
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/encounters |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_domain["domain"] --> n_foundation["foundation"] n_domain["domain"] --> n_identity["identity"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
| `identity-parties` | identity | 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_encounters["application-encounters"] -->|uses| SELF SELF["domain-encounters"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] SELF -->|runtime| n_identity_parties["identity-parties"] 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_encounters | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
EncounterError | 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-encounters.
Verification
| Kind | Count |
|---|---|
| Unit tests | 29 |
| 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_encounter_add_participant—src/lib.rstest_encounter_at_location—src/lib.rstest_encounter_cancel—src/lib.rstest_encounter_cancel_after_complete—src/lib.rstest_encounter_complete—src/lib.rstest_encounter_complete_not_started—src/lib.rstest_encounter_duration—src/lib.rstest_encounter_full_workflow—src/lib.rstest_encounter_new—src/lib.rstest_encounter_no_show—src/lib.rstest_encounter_no_show_after_started—src/lib.rstest_encounter_pause_resume—src/lib.rstest_encounter_present_participants—src/lib.rstest_encounter_scheduled_for—src/lib.rstest_encounter_serialization—src/lib.rstest_encounter_set_notes—src/lib.rstest_encounter_start—src/lib.rstest_encounter_start_already_started—src/lib.rstest_encounter_state_can_complete—src/lib.rstest_encounter_state_can_pause—src/lib.rstest_encounter_state_can_start—src/lib.rstest_encounter_state_display—src/lib.rstest_encounter_state_from_str—src/lib.rstest_encounter_state_is_final—src/lib.rstest_encounter_type_display—src/lib.rstest_encounter_with_description—src/lib.rstest_participant_join_leave—src/lib.rstest_participant_new—src/lib.rstest_participant_serialization—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 31 | 39 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 31
"No rustdoc detected" : 8
Metrics
| Metric | Value |
|---|---|
| Rust source files | 1 |
| Source lines | 825 |
| Code lines | 581 |
| Public API items | 39 |
| Public modules | 0 |
| Tests | 29 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 7 |
| Workspace reverse dependencies | 1 |
pie showData
title Public API by kind
"enum" : 3
"method" : 33
"struct" : 2
"type alias" : 1
pie showData
title Rust source composition
"Code" : 581
"Blank or comment" : 244
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.