pub struct DryRun<'s>(/* private fields */);Expand description
The dry-run view of the document operations (spec/surface §4, 1.3; the
reference’s DocOpContext.dryRun): the same four calls as on Store,
each validating exactly as the real run does (doc_missing,
path_taken, …), writing and committing nothing, and returning
committed: false with the per-file diffs. A create still mints its
d_ id (apply’s rule: a dry run consumes the id the real run would
take next). Obtained from Store::dry_run.
Implementations§
Source§impl DryRun<'_>
impl DryRun<'_>
Sourcepub fn docs_create(
&mut self,
ctx: &DocOpContext,
doc_store: &mut dyn DocStore,
path: &str,
markdown: &str,
frontmatter: Option<&Map<String, Value>>,
) -> Result<DocOpResult>
pub fn docs_create( &mut self, ctx: &DocOpContext, doc_store: &mut dyn DocStore, path: &str, markdown: &str, frontmatter: Option<&Map<String, Value>>, ) -> Result<DocOpResult>
docs_create without writing: { "<path>": { before: "", after: bytes } }.
Sourcepub fn docs_move(
&mut self,
ctx: &DocOpContext,
doc_store: &mut dyn DocStore,
doc_ref: &str,
to_path: &str,
retarget_inbound: bool,
) -> Result<DocMoveResult>
pub fn docs_move( &mut self, ctx: &DocOpContext, doc_store: &mut dyn DocStore, doc_ref: &str, to_path: &str, retarget_inbound: bool, ) -> Result<DocMoveResult>
docs_move without renaming: the old path → "", the new path ←
bytes; with retarget_inbound, dangling/retargeted as the real
run would report them and the rewritten sources’ diffs.
Sourcepub fn docs_delete(
&mut self,
ctx: &DocOpContext,
doc_store: &mut dyn DocStore,
doc_ref: &str,
) -> Result<DocOpResult>
pub fn docs_delete( &mut self, ctx: &DocOpContext, doc_store: &mut dyn DocStore, doc_ref: &str, ) -> Result<DocOpResult>
docs_delete without deleting: { "<path>": { before: bytes, after: "" } }.
Sourcepub fn docs_set_meta(
&mut self,
ctx: &DocOpContext,
doc_store: &mut dyn DocStore,
doc_ref: &str,
set: Option<&Map<String, Value>>,
unset: &[String],
) -> Result<DocOpResult>
pub fn docs_set_meta( &mut self, ctx: &DocOpContext, doc_store: &mut dyn DocStore, doc_ref: &str, set: Option<&Map<String, Value>>, unset: &[String], ) -> Result<DocOpResult>
docs_set_meta without writing: the file before → after the patch.