Expand description
Structured metadata declared in stdlib HarnDoc blocks.
Every public stdlib function is expected to carry five fields above its
pub fn declaration:
/**
* Returns the contents of `path`.
*
* @effects: [fs.read]
* @allocation: heap
* @errors: [FileNotFound, PermissionDenied]
* @api_stability: stable
* @example: let s = fs::read_to_string(harness.fs, "/x")
*/
pub fn read_to_string(...) -> ... { ... }These fields drive harn graph --json, LSP hover, and the
HARN-STD-101 lint that enforces coverage on stdlib sources.
Structs§
- Stdlib
Metadata - One declared metadata field on a stdlib function. Empty lists and
missing fields are distinct:
effects: Some(vec![])records an explicit[]declaration (“statically certified pure”), whileeffects: Nonemeans the author has not annotated the function yet.
Functions§
- parse_
for_ span - Extract a canonical
/** ... */block immediately above the given span and parse its metadata fields. Returns the parsed metadata even if no fields are declared so callers can detect “doc present, fields missing”. - parse_
from_ doc_ body - Parse all
@key: valuefields from the body of a canonical/** ... */HarnDoc block. The body should be the inner text with/**, leading*, and*/markers already stripped, one line per element. Multi-line@example:continuations are joined while preserving trailing newlines.