pub struct Migrator { /* private fields */ }Expand description
The migrator. Stateless by design — run is a pure fn of input.
Use Migrator::default for the standard transform table. Custom
consumers can construct with Migrator::new(&[...]) to add / omit
rules for their yaml corpus (currently unused; opened for future
extension without wire-format changes).
Implementations§
Source§impl Migrator
impl Migrator
Sourcepub fn migrate(
&self,
yaml: &str,
) -> Result<(String, MigrateReport), MigrateError>
pub fn migrate( &self, yaml: &str, ) -> Result<(String, MigrateReport), MigrateError>
Comment-preserving line-based codemod. Copyright headers, audit
trails, and # Reason: blocks survive the migrate round-trip
byte-identical.
Strategy:
- Iterate input line by line
- Preserve comment / blank / doc-header lines verbatim
- Detect step lines (
^\s*-\s+<verb>[:.]?) and rewrite the verb portion usingsmix_verbs::VERB_TABLE - Argument transforms (e.g.
timeout→timeoutMs,max→maxRetries) run against the arg mapping only when the arg is inline on the same step line — for multi-line mappings we scan following-indented lines
The prior serde_norway::Value roundtrip is retained as a fallback for edge cases: when the line-based rewriter can’t confidently identify a step (deeply nested / complex flow- style), fall back to the AST path for that yaml doc.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Migrator
impl RefUnwindSafe for Migrator
impl Send for Migrator
impl Sync for Migrator
impl Unpin for Migrator
impl UnsafeUnpin for Migrator
impl UnwindSafe for Migrator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more