Directory listings linking Party (Person) to directory contexts with domain-specific metadata
| Tier | content |
| Role | unclassified (baselined) |
| Path | crates/content/directory-listing |
| Edition | 2021 |
| Targets | content_directory_listing |
| Public items | 0 across 0 modules |
| Tests | 20 |
What it is for
Directory Listing Library crates
This crate provides library crates for linking a Person (from identity-parties) to directory contexts with domain-specific metadata.
# Design Principle
Follows the Person + DirectoryListing pattern (similar to User + Role):
- Person (from
identity-parties) handles all identity and contact info - DirectoryListing is the "role" linking Person to a directory context
- Domain-specific data lives in JSONB metadata
- "ContactCard" is a VIEW/projection, not a domain model
# Example Usage
use content_directory_listing::{DirectoryListing, SubstituteOrganistMeta};
use uuid::Uuid;
// Create a listing for a person
let person_id = Uuid::new_v4();
let listing = DirectoryListing::new(person_id, "substitute_organist")
.with_metadata(serde_json::json!({
"services": "sunday", "funerals",
"instruments": "organ", "piano",
"area_coverage": "all"
}))
.with_status("approved");
// Parse domain-specific metadata
if let Some(meta) = listing.try_as_substitute_meta() {
println!("Services: {}", meta.services_display());
}
# Listing Types (validate at app layer, not DB)
substitute_organist: Church organist substitutesvendor: Service providers (organ tuners, music stores)board_member: Organization officerschapter_member: Member directory entries- Any custom type your application needs
# Status Values
pending: Submitted, awaiting reviewapproved: Visible to publicrejected: Admin rejectedsuspended: Temporarily hiddenarchived: No longer active
Capabilities
No public items.
How to use it
From this crate's own rustdoc:
use content_directory_listing::{DirectoryListing, SubstituteOrganistMeta};
use uuid::Uuid;
// Create a listing for a person
let person_id = Uuid::new_v4();
let listing = DirectoryListing::new(person_id, "substitute_organist")
.with_metadata(serde_json::json!({
"services": ["sunday", "funerals"],
"instruments": ["organ", "piano"],
"area_coverage": "all"
}))
.with_status("approved");
// Parse domain-specific metadata
if let Some(meta) = listing.try_as_substitute_meta() {
println!("Services: {}", meta.services_display());
}
Module structure
No public modules: the crate root is its whole surface.
Public surface
No public items.
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
DirectoryError | error::DirectoryError |
DirectoryListing | listing::DirectoryListing |
{BoardMemberMeta,ChapterMemberMeta,DeanTerm,OfficerMeta,OpenPositionMeta,PastDeanMeta,SubstituteOrganistMeta,VendorMeta,} | metadata::{BoardMemberMeta,ChapterMemberMeta,DeanTerm,OfficerMeta,OpenPositionMeta,PastDeanMeta,SubstituteOrganistMeta,VendorMeta,} |
{ListingStatus,ListingType} | enums::{ListingStatus,ListingType} |
Boundary
Reaches into foundation.
Shares tier content with 5 other crates: content-assets, content-calendar, content-calendar-recurrence, content-cms, content-notes.
_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) | content |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/content/directory-listing |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_content["content"] --> 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, serde | 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_directory_listing["application-directory-listing"] -->|uses| SELF SELF["content-directory-listing"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
| Feature | Enables | On by default |
|---|---|---|
default | — | yes |
flowchart LR n_default["default"]
Targets
| Kind | Name | Source |
|---|---|---|
| lib | content_directory_listing | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
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-directory-listing.
Verification
| Kind | Count |
|---|---|
| Unit tests | 20 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 1 |
What the tests establish, by name:
test_listing_status_is_public—src/enums.rstest_listing_status_needs_review—src/enums.rstest_listing_type_as_str—src/enums.rstest_listing_type_parse—src/enums.rstest_error_display—src/error.rstest_create_listing—src/lib.rstest_listing_with_metadata—src/lib.rstest_approval_workflow—src/listing.rstest_builder_chain—src/listing.rstest_new_listing—src/listing.rstest_rejection_workflow—src/listing.rstest_traits—src/listing.rstest_board_member_meta—src/metadata.rstest_open_position_meta_defaults—src/metadata.rstest_open_position_meta_display—src/metadata.rstest_open_position_meta_empty_contact—src/metadata.rstest_substitute_meta_defaults—src/metadata.rstest_substitute_meta_display—src/metadata.rstest_substitute_meta_empty_display—src/metadata.rstest_vendor_meta—src/metadata.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 0 | 0 |
Public modules with a //! block | 0 | 0 |
Metrics
| Metric | Value |
|---|---|
| Rust source files | 5 |
| Source lines | 1154 |
| Code lines | 759 |
| Public API items | 0 |
| Public modules | 0 |
| Tests | 20 |
| Examples | 0 |
| Cargo features | 1 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 1 |
pie showData
title Rust source composition
"Code" : 759
"Blank or comment" : 395
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.