Skip to main content

Move

Enum Move 

Source
pub enum Move {
    Cut(Cut),
    JoinFolds(Vec<u32>),
    LinkFoldState(Vec<u32>),
    SetCollapsed((u32, bool)),
    SetLabel((u32, Option<String>)),
    SetTags((u32, Vec<String>)),
}
Expand description

What a plugin asks for. A region is named by its id, or the file by 0 where a move allows it. Moves are carried out in order, and the next plugin sees the result; a move that cannot be carried out aborts the run with mutation_failed.

Fresh ids. When a plugin’s moves begin, the next fresh id is one above the largest region id in the file (both sides), and the next fresh alignment id one above the largest leaf alignment id. Moves take fresh ids in order, lhs side before rhs side:

  • a cut takes the next alignment id, which the second pieces share, then gives the second piece on each side that holds the leaf (or its paired leaf) the next id, lhs first. Both second pieces take the lhs piece’s id (or the only piece’s) as their fold state id. The first piece keeps the leaf’s ids.
  • a join-folds gives the new fold on each side that holds the listed regions the next id, lhs first; both share the lhs fold’s id as their fold state id.

No other move takes an id. So a plugin that cuts a leaf with id l, paired on the rhs, when the largest id is n, names the lhs second piece n + 1 and the rhs one n + 2.

Variants§

§

Cut(Cut)

Split a leaf, and the leaf paired with it, at a line offset.

§

JoinFolds(Vec<u32>)

Wrap two or more consecutive siblings on each side that holds them in a new open, unlabelled fold without tags.

§

LinkFoldState(Vec<u32>)

Every region in the listed regions’ fold states takes the first region’s fold state id and collapsed state.

§

SetCollapsed((u32, bool))

Collapse or open every region sharing the region’s fold state, or hide or show the file (0).

§

SetLabel((u32, Option<String>))

Set or clear the label of one region, or of the file (0).

§

SetTags((u32, Vec<String>))

Replace one region’s tags. The file’s tags cannot be set here.

Trait Implementations§

Source§

impl Clone for Move

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Move

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Move

Source§

impl PartialEq for Move

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Move

Auto Trait Implementations§

§

impl Freeze for Move

§

impl RefUnwindSafe for Move

§

impl Send for Move

§

impl Sync for Move

§

impl Unpin for Move

§

impl UnsafeUnpin for Move

§

impl UnwindSafe for Move

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Resource for T
where T: 'static,

Source§

type Rep = Option<T>

The type which is actually stored in-memory for this resource. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.