Skip to main content

Crate logloom

Crate logloom 

Source
Expand description

Parse existing changelogs without filesystem access.

Parsing preserves source order and Markdown. Convention checks are a separate operation: invalid dates, for example, remain available for inspection.

use logloom::{parse, validate, Format};

let changelog = parse("# Changelog\n\n## [Unreleased]\n\n### Added\n- A library.\n",
                      Format::KeepAChangelog)?;
assert_eq!(changelog.releases.len(), 1);
assert!(validate(&changelog).is_empty());
let json = serde_json::to_string(&changelog)?;

Structs§

Changelog
An owned, serializable changelog independent of its source format.
Diagnostic
A convention check result with a one-based source line when available.
Entry
A top-level list item, Markdown block, or raw text block within a section.
LinkDefinition
One effective CommonMark link definition; duplicate definitions remain in source.
Metadata
Document-level information; arbitrary metadata stays in the introduction.
ParseError
A structured parsing failure with an optional one-based source line.
Release
A release identifier is opaque: neither SemVer nor chronological sorting is imposed.
Section
A group of ordered entries.
Span
Half-open UTF-8 byte offsets in the original source, plus a one-based line.

Enums§

Category
A normalized category with a lossless fallback for other names.
DetectionError
A conservative format detector’s failure, separate from convention validation.
DiagnosticCode
Stable machine-readable convention diagnostic codes.
EntryKind
Structural origin of an entry.
ErrorKind
Classification of a parsing failure, independent of its human-readable text.
Format
Supported input formats. More formats may be added in future releases.
Severity
Importance of a convention diagnostic. Parsing itself has already succeeded.

Constants§

MAX_INPUT_BYTES
Maximum UTF-8 input size (16 MiB), enforced before Markdown parsing.

Functions§

detect
Detect a format from specific content signatures without I/O or validation.
detect_named
Detect with a filename hint for numeric or anonymous Towncrier fragments.
parse
Parse an in-memory document, retaining its original content and ordering.
parse_named
Parse with an optional source filename’s semantic information, without I/O.
validate
Check the source format’s conventions without mutating or sorting content.
validate_for_format
Validate with the conventions of the selected input format.