Expand description
Public typed mutation API for vault edits.
Each builder exposes two methods: plan(&self, vault) -> Result<MutationReport>
produces a read-only preview without touching disk, and
execute(self, vault) -> Result<MutationReport> applies the planned changes
and returns the same shape of report.
The report shape is intentionally small — a vector of PlannedChange (path
plus a human-readable description) and a vector of MutationError for any
per-record failures. Consumers that need before/after frontmatter snapshots
can compute them by running their own diff against the records on disk.
Structs§
- Create
Builder - Build a create mutation. Writes a new
.mdfile underfolderwith namename(the.mdextension is appended automatically). - Delete
Builder - Build a delete mutation. Records matching
filterare moved to<vault>/.trash/by default (collision-safe). Withpermanent(true), files are removed entirely. - Move
Builder - Build a move mutation. Records matching
filterare relocated intoto_folder(created if needed). Filename collisions at the destination surface asMutationErrors in the report. - Mutation
Error - A failure to apply a single change.
- Mutation
Report - A report of changes a builder would (or did) make.
- Planned
Change - A single planned (or applied) change to one record.
- Rename
Builder - Build a rename mutation. The single record at
<folder>/<from>.mdis renamed to<folder>/<to>.md, and every[[wikilink]]across the vault pointing atfromis rewritten to point atto. - Update
Builder - Build an update mutation. The
filterselects records; the chainedset/unset/add_tag/remove_tagcalls accumulate operations applied to each matching record’s frontmatter. Body mutations (set_body/append_body/clear_body) operate on the markdown section after the frontmatter.