pub struct PatchEngine { /* private fields */ }
Implementations§
Source§impl PatchEngine
impl PatchEngine
pub fn new() -> Self
pub fn add_patch(&mut self, patch: Patch)
pub fn add_patches(&mut self, patches: impl IntoIterator<Item = Patch>)
pub fn insert_before( &mut self, node: &impl HasSpan, text: impl Into<EcoString>, ) -> Result<(), PatchError>
pub fn insert_after( &mut self, node: &impl HasSpan, text: impl Into<EcoString>, ) -> Result<(), PatchError>
pub fn replace_node( &mut self, node: &impl HasSpan, text: impl Into<EcoString>, ) -> Result<(), PatchError>
pub fn delete_node(&mut self, node: &impl HasSpan) -> Result<(), PatchError>
pub fn apply_all(self, source: &str) -> Result<String, PatchError>
pub fn apply_all_with_offset( self, snippet: &str, base_offset: usize, ) -> Result<String, PatchError>
Auto Trait Implementations§
impl Freeze for PatchEngine
impl RefUnwindSafe for PatchEngine
impl Send for PatchEngine
impl Sync for PatchEngine
impl Unpin for PatchEngine
impl UnwindSafe for PatchEngine
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