pub enum Edit<'a, P> {
Replace {
from: Position<P>,
to: Position<P>,
text: &'a str,
},
Split {
at: Position<P>,
},
Format {
from: Position<P>,
to: Position<P>,
mark: Mark,
on: bool,
},
}Expand description
A change the editor asks the model to make.
Variants§
Replace
Replace the text from one position to another with new text. The two
may be in different paragraphs, from first in document order; the
model then joins what is left of the first and the last. The new text
never holds a paragraph break: '\n' in it is a line break inside the
paragraph, and '\t' a tab.
Fields
Split
Split a paragraph in two at a position, the second half becoming the paragraph after it.
Format
Give the text from one position to another a mark, or take it off.
The two may be in different paragraphs, from first in document
order; no paragraph is joined or split.
Trait Implementations§
impl<'a, P: Eq> Eq for Edit<'a, P>
impl<'a, P: PartialEq> StructuralPartialEq for Edit<'a, P>
Auto Trait Implementations§
impl<'a, P> Freeze for Edit<'a, P>
impl<'a, P> RefUnwindSafe for Edit<'a, P>where
Position<P>: RefUnwindSafe,
impl<'a, P> Send for Edit<'a, P>
impl<'a, P> Sync for Edit<'a, P>
impl<'a, P> Unpin for Edit<'a, P>
impl<'a, P> UnsafeUnpin for Edit<'a, P>where
Position<P>: UnsafeUnpin,
impl<'a, P> UnwindSafe for Edit<'a, P>where
Position<P>: UnwindSafe,
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§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