calternal_notes_core::rename
Pure title-retitle planning. The host applies these byte edits and performs
the journalled write-new, verify, delete-old sequence through calternal-fs.
Source: crates/calternal-notes-core/src/rename.rs
Structs
Section titled “Structs”ByteEdit
Section titled “ByteEdit”pub struct ByteEditNo doc comment.
Fields
pub range: Range<usize>pub replacement: String
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/rename.rs:25
NoteInput
Section titled “NoteInput”pub struct NoteInputNo doc comment.
Fields
pub path: Stringpub content: String
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/rename.rs:19
ReferrerEdits
Section titled “ReferrerEdits”pub struct ReferrerEditsNo doc comment.
Fields
pub path: Stringpub edits: Vec<ByteEdit>
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/rename.rs:31
RenamePlan
Section titled “RenamePlan”pub struct RenamePlanNo doc comment.
Fields
pub old_path: Stringpub new_path: Stringpub new_content: String: Updated Note bytes. Hosts write this to the new path before removing old.pub referrers: Vec<ReferrerEdits>: Exact destination-only changes for every referrer that points to this Note.pub label: String: The title written as the label of rewritten wikilinks. Withrewrite_referrerit rebuilds one referrer’s edits on newer text.
Implements: Debug, Clone, PartialEq, Eq
Source: crates/calternal-notes-core/src/rename.rs:37
Functions
Section titled “Functions”apply_byte_edits
Section titled “apply_byte_edits”pub fn apply_byte_edits(text: &str, edits: &[ByteEdit]) -> Result<String, String>Apply a non-overlapping byte-edit list from right to left.
Source: crates/calternal-notes-core/src/rename.rs:316
plan_move
Section titled “plan_move”pub fn plan_move( note: &NoteInput, new_path: &str, referrers: &[NoteInput],) -> Result<RenamePlan, String>Plan a folder move with the same link rewrite rules as a retitle.
Source: crates/calternal-notes-core/src/rename.rs:104
plan_rename
Section titled “plan_rename”pub fn plan_rename( note: &NoteInput, new_title: &str, referrers: &[NoteInput],) -> Result<RenamePlan, String>Build a title retitle plan without reading or writing a filesystem.
referrers is the host’s already-resolved backlink set. The caller discovers
those Notes through its index, then applies the returned byte edits under
calternal-fs; this pure planner does not try to enumerate vault files.
Source: crates/calternal-notes-core/src/rename.rs:54
rewrite_referrer
Section titled “rewrite_referrer”pub fn rewrite_referrer( referrer: &NoteInput, old_path: &str, new_path: &str, label: &str,) -> Result<String, String>Rewrite one referrer’s links to a moved or retitled Note on the
referrer’s current text, with the same rules as the plan. A host uses it
when the referrer changed after the plan was made (#98): writing the
planned bytes then would drop that change. label is
RenamePlan::label.