pub enum AnchorOp {
SetLine {
line: usize,
hash: String,
new_text: String,
},
ReplaceLines {
start_line: usize,
start_hash: String,
end_line: usize,
end_hash: String,
new_text: String,
},
InsertAfter {
line: usize,
hash: Option<String>,
new_text: String,
},
Delete {
start_line: usize,
start_hash: String,
end_line: usize,
end_hash: String,
},
Create {
new_text: String,
},
}Expand description
A single anchored edit. new_text="" deletes (readseek convention); a
multi-line new_text expands one anchor into several lines.
Variants§
SetLine
Replace (or delete, if new_text=="") a single line.
ReplaceLines
Replace (or delete) the inclusive line range start..=end.
InsertAfter
Insert after line (line 0 = top of file, needs no hash).
Delete
Delete the inclusive line range start..=end (sugar for an empty
ReplaceLines; a single-line delete uses start==end).
Create
Create a NEW file with new_text as its content. No anchors — the file
must not exist yet (strict, unlike ctx_edit create=true which
overwrites). Handled before the preimage read; cannot be mixed with
anchored ops in one call (a batch shares a single existing preimage).
Trait Implementations§
impl Eq for AnchorOp
impl StructuralPartialEq for AnchorOp
Auto Trait Implementations§
impl Freeze for AnchorOp
impl RefUnwindSafe for AnchorOp
impl Send for AnchorOp
impl Sync for AnchorOp
impl Unpin for AnchorOp
impl UnsafeUnpin for AnchorOp
impl UnwindSafe for AnchorOp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more