Skip to main content

Crate feature_manifest

Crate feature_manifest 

Source
Expand description

Library API for the cargo-feature-manifest and cargo-fm tools.

The command-line interface and metadata format are the primary supported surfaces before 1.0. The library API is available for integrations and tests, but may still change while the crate is pre-1.0.

The crate reads Cargo feature definitions, attaches maintainer-authored metadata, validates common documentation and policy mistakes, and renders the result for docs or automation.

Typical entry points:

Structs§

DependencyInfo
Dependency details relevant to feature validation.
Feature
A single Cargo feature and its associated metadata.
FeatureGroup
A logical grouping of related features.
FeatureManifest
A normalized view of Cargo features plus structured feature metadata.
FeatureMetadata
Additional author-provided metadata for a feature.
InjectionMarkers
Marker pair used for injecting generated content into an existing file.
InjectionReport
Result of a marker-based document injection.
Issue
A single validation finding produced by validate.
LintDoc
Documentation for a supported lint code.
ManifestSourceMap
Lightweight source map for locating feature-manifest diagnostics in TOML.
MarkerReport
Marker discovery details for a generated documentation region.
SourceSpan
Best-effort source location inside a manifest file.
SyncOptions
Options controlling how sync_manifest rewrites metadata.
SyncPreview
Non-writing result from a manifest synchronization preview.
SyncReport
Summary of a manifest synchronization pass.
ValidateOptions
Configuration applied during validation.
ValidationReport
Aggregated output from a validation run.
WorkspaceManifest
A workspace-aware view of one or more Cargo packages selected for analysis.

Enums§

FeatureRef
A typed reference inside a feature definition.
LintLevel
Severity override policy for a specific lint code.
LintPreset
A named lint policy intended to make adoption and strict CI setup easier.
MetadataLayout
Layout used for feature metadata inside package.metadata.
PackageSelection
Selects which package set to load from a Cargo workspace.
Severity
Severity level attached to a validation issue.

Constants§

FEATURE_DOCS_METADATA_TABLE
Legacy compatibility table name under [package.metadata].
FEATURE_MANIFEST_METADATA_TABLE
Canonical table name under [package.metadata].
KNOWN_LINT_CODES
Lint codes recognized by validation and CLI override parsing.

Functions§

ensure_injection_markers
Ensures a document contains a marker pair, appending it when absent.
inject_between_markers
Replaces the region between two markers, preserving the markers themselves.
injected_region_matches
Returns true when the region between markers already matches the expected contents.
inspect_markers
Returns marker status for a document without changing it.
known_lint_codes
Returns the known lint codes in stable order.
lint_docs
Returns generated documentation for all known lint codes.
load_manifest
Loads and parses a manifest from disk.
load_workspace
Loads a selected package set from Cargo metadata and parses each manifest.
output_matches
Returns true when a generated file already matches the expected contents.
parse_lint_override
Parses a lint override string like missing-description=warn.
parse_manifest_str
Parses a manifest from a TOML string and normalizes its feature metadata.
preview_sync_manifest
Computes the synchronization result and rewritten TOML without writing it.
render_explain
Renders a human-readable explanation for a named feature.
render_json
Renders the selected workspace/package metadata as pretty-printed JSON.
render_markdown
Renders the selected packages as Markdown.
render_mermaid
Renders selected packages as a Mermaid graph.
render_sync_diff
Renders a compact unified diff for a manifest preview.
resolve_manifest_path
Resolves a manifest path from either a Cargo.toml file or a crate directory. When omitted, the current directory is used.
sync_manifest
Adds missing metadata scaffolding to a manifest in place.
validate
Validates a manifest for missing docs, stale metadata, and risky defaults.
validate_with_options
Validates a manifest with CLI lint overrides applied on top of manifest config.
write_output
Writes generated content to a file, ensuring a trailing newline.