Skip to main content

Edit

Enum Edit 

Source
#[non_exhaustive]
pub enum Edit {
Show 16 variants AddNode { name: String, params: Vec<String>, body: String, after: Option<String>, }, RemoveNode { name: String, }, RenameNode { from: String, to: String, }, AddBranch { node: String, guard: String, outcome: String, before: Option<usize>, }, RemoveBranch { node: String, index: usize, }, MoveBranch { node: String, from: usize, to: usize, }, SetGuard { node: String, index: usize, guard: String, }, SetOutcome { node: String, index: usize, outcome: String, }, SetAnnotation { on: Declaration, name: String, value: Value, }, RemoveAnnotation { on: Declaration, name: String, }, AddParam { name: String, default: Value, }, RemoveParam { name: String, }, AddEvent { name: String, }, RemoveEvent { name: String, }, AddEntry { node: String, }, RemoveEntry { node: String, },
}
Expand description

A change a builder can make. Text fields hold flow syntax exactly as it would be typed: a guard is a temple expression, an outcome is a jump, a value, an ask or ignore, and a body is everything after node name =. A guard or outcome can’t hold a # comment, which would hide the rest of the line it lands on.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AddNode

Add node name(params) = body after node after, or at the end.

Fields

§name: String

The new node’s name.

§params: Vec<String>

Its parameter names.

§body: String

Everything after =.

§after: Option<String>

The node to add it after; None for the end of the file.

§

RemoveNode

Remove a node and its annotations. Jumps to it become errors to fix.

Fields

§name: String

The node.

§

RenameNode

Rename a node and every jump, ask continuation and entry naming it.

Fields

§from: String

The node.

§to: String

Its new name.

§

AddBranch

Add guard: outcome before branch before, or before else when None. A node with a single outcome gains a when block, with its old outcome as else.

Fields

§node: String

The node.

§guard: String

The new branch’s guard.

§outcome: String

The new branch’s outcome.

§before: Option<usize>

The branch to add it before.

§

RemoveBranch

Remove branch index of a node’s when.

Fields

§node: String

The node.

§index: usize

The branch, counting from 0.

§

MoveBranch

Move a branch; else has to stay last.

Fields

§node: String

The node.

§from: usize

Where the branch is, counting from 0.

§to: usize

Where it goes.

§

SetGuard

Replace a branch’s guard. "else" makes the last branch the else.

Fields

§node: String

The node.

§index: usize

The branch, counting from 0.

§guard: String

The new guard.

§

SetOutcome

Replace a branch’s outcome. A single-outcome node’s outcome is index 0.

Fields

§node: String

The node.

§index: usize

The branch, counting from 0.

§outcome: String

The new outcome.

§

SetAnnotation

Set @name = value on the flow, a param or a node.

Fields

§on: Declaration

The declaration it sits on.

§name: String

The name after @.

§value: Value

Its value.

§

RemoveAnnotation

Remove @name from the flow, a param or a node.

Fields

§on: Declaration

The declaration it sits on.

§name: String

The name after @.

§

AddParam

Add param name = default after the other params.

Fields

§name: String

The param’s name.

§default: Value

Its default.

§

RemoveParam

Remove a param and its annotations.

Fields

§name: String

The param.

§

AddEvent

Declare an event.

Fields

§name: String

The event.

§

RemoveEvent

Remove an event from events.

Fields

§name: String

The event.

§

AddEntry

List a node under entry.

Fields

§node: String

The node.

§

RemoveEntry

Remove a node from entry.

Fields

§node: String

The node.

Trait Implementations§

Source§

impl Clone for Edit

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 Edit

Source§

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

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

impl PartialEq for Edit

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 Edit

Auto Trait Implementations§

§

impl Freeze for Edit

§

impl RefUnwindSafe for Edit

§

impl Send for Edit

§

impl Sync for Edit

§

impl Unpin for Edit

§

impl UnsafeUnpin for Edit

§

impl UnwindSafe for Edit

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.