Skip to main content

Crate merman_core

Crate merman_core 

Source
Expand description

Mermaid parser + semantic model (headless).

Design goals:

  • 1:1 parity with the repository’s pinned upstream Mermaid baseline
  • deterministic, testable outputs (semantic snapshot goldens)
  • runtime-agnostic async APIs (no specific executor required)

Default features are empty. Select diagram-* features for the required logical families or all-diagrams for the complete parser surface. Family-exclusive public model types and enum variants are conditional; recognition and custom registries remain available without a family.

Re-exports§

pub use config::MermaidConfig;
pub use detect::Detector;
pub use detect::DetectorRegistry;
pub use diagram::AGENTFLOW_CONTAINMENT_VIOLATION_WARNING_RULE_ID;
pub use diagram::AGENTFLOW_SHAPE_REMOVED_WARNING_RULE_ID;
pub use diagram::AGENTFLOW_SHAPE_UNSUPPORTED_WARNING_RULE_ID;
pub use diagram::BLOCK_WIDTH_WARNING_RULE_ID;
pub use diagram::BuiltinRenderSemantic;
pub use diagram::CapturedPanic;
pub use diagram::CustomJsonProvenance;
pub use diagram::CustomJsonRenderModel;
pub use diagram::CustomJsonRenderParser;
pub use diagram::DiagramParseOutcome;
pub use diagram::DiagramParseSnapshot;
pub use diagram::DiagramRegistry;
pub use diagram::DiagramSemanticParser;
pub use diagram::DiagramSnapshotCapture;
pub use diagram::DiagramWarningFact;
pub use diagram::FLOWCHART_EXPLICIT_DIRECTION_WARNING_RULE_ID;
pub use diagram::FLOWCHART_UNKNOWN_STYLE_TARGET_WARNING_RULE_ID;
pub use diagram::GIT_GRAPH_DUPLICATE_COMMIT_WARNING_RULE_ID;
pub use diagram::ParsedDiagram;
pub use diagram::ParsedDiagramRender;
pub use diagram::ParsedEditorFacts;
pub use diagram::RenderDiagramRegistry;
pub use diagram::RenderSemanticModel;
pub use editor::EditorExpectedSyntax;
pub use editor::EditorExpectedSyntaxKind;
pub use editor::EditorFamilySemantics;
pub use editor::EditorRenamePolicy;
pub use editor::EditorSemanticCompleteness;
pub use editor::EditorSemanticDiagnostic;
pub use editor::EditorSemanticDiagnosticKind;
pub use editor::EditorSemanticFacts;
pub use editor::EditorSemanticKind;
pub use editor::EditorSemanticRole;
pub use editor::EditorSemanticSymbol;
pub use editor::SourceSpan;
pub use error::Error;
pub use error::ParseDiagnostic;
pub use error::ParseDiagnosticSpanKind;
pub use error::Result;
pub use operation::CancelReason;
pub use operation::OperationCancelled;
pub use operation::OperationControl;
pub use operation::OperationControlResult;
pub use operation::OperationLedgerError;
pub use operation::OperationPhase;
pub use operation::OperationResourceDomain;
pub use operation::OperationResourceLimitExceeded;
pub use operation::OperationResourceOverride;
pub use operation::OperationResourceProvenance;
pub use preprocess::PreprocessResult;
pub use preprocess::PreprocessedSource;
pub use preprocess::preprocess_diagram;
pub use preprocess::preprocess_diagram_with_known_type;

Modules§

baseline
Active upstream Mermaid baseline metadata.
common
common_db
config
detect
diagram
diagrams
Public data models for Mermaid diagram families.
editor
entities
error
generated
geom
models
operation
Target-neutral lifecycle primitives for CPU-bound Merman operations.
preprocess
resources
Backend-independent Mermaid source and semantic-model resource policy.
runtime
sanitize
svg_security
theme_color
Source-backed color operations used by Mermaid themes and renderers.
time
utils

Structs§

BuiltInTypedRenderFamily
Canonical public identity for one compiled concrete built-in typed render family.
DiagramFamilyCapability
DiagramFamilyId
Closed, catalog-owned identity for one logical Mermaid diagram family.
DiagramFamilySelector
Public Cargo selector for one logical family, regardless of this build’s availability.
DiagramHeaderFact
Engine
Headless Mermaid parser engine.
ManagedSemanticJson
Mermaid-compatible JSON with iterative ownership and export.
ParseMetadata
Metadata extracted before semantic diagram parsing.
ParseOptions
Parser behavior switches for model-producing parse facades.

Constants§

MAX_DIAGRAM_NESTING_DEPTH
Maximum nested diagram/include depth accepted by recursive parsers.

Functions§

built_in_typed_render_families
Returns each compiled concrete built-in typed render-model family exactly once.
diagram_family_capabilities
Returns every known Mermaid diagram id in the pinned baseline, including unavailable ones.
diagram_family_selectors
Returns the complete catalog-owned mapping from logical families to Cargo selectors.
diagram_header_facts
Returns known header facts for Mermaid diagram starters in the pinned baseline.
diagram_type_family_id
diagram_type_family_kind
diagram_type_metadata_id
diagram_type_render_model_kind
supported_diagrams
Returns metadata names backed by semantic parsers compiled into this build.
supported_themes
Returns Mermaid theme names supported by the pinned baseline.