pub enum Action {
Show 39 variants
Arm(ToolName),
ToggleDiagnostic,
ToggleFrameRate,
ArmAddRouteLabel(RouteId),
OpenEditor(EditTarget),
StampTool {
tool: ToolName,
at: Pos2,
},
Delete(Deletable),
Copy(Vec<ShapeId>),
CopyPins(Vec<PinId>),
Cut(Vec<ShapeId>),
CutPins(Vec<PinId>),
SetPinTags {
pins: Vec<PinId>,
tags: TagVisibility,
},
SetShapeTagHidden {
shape: ShapeId,
tags: TagVisibility,
},
FlipShapePins(ShapeId),
FlipBlockVertical(BlockId),
SetBlockLocked {
block: BlockId,
lock: InterfaceLock,
},
Paste(String),
ExpandBlock(BlockId),
Zoom(ZoomStep),
GoToPath(BlockPath),
SetRole {
target: RoleTarget,
role: Option<u8>,
},
SetPinsKind {
pins: Vec<PinId>,
kind: PinDir,
},
GoUp,
AcknowledgeFailure(usize),
FrameRect(Rect),
NavSelect {
block: BlockId,
extend: bool,
},
Undo,
Redo,
Nudge {
dx: i32,
dy: i32,
},
ResetView,
Export {
format: ExportFormat,
selection: Option<Vec<ShapeId>>,
},
SetIcon {
block: BlockId,
asset: Asset,
},
PlaceImage {
asset: Asset,
},
Reroute(RouteId),
RerouteBlock(BlockId),
ViewRev(Rev),
ViewHead,
SetPalette(Palette),
TagRev {
at: Rev,
name: String,
how: Tagging,
},
}Expand description
Variants§
Arm(ToolName)
Arm the fresh tool Tool::from_name gives for this name.
ToggleDiagnostic
Toggle the author’s diagnostic overlay.
ToggleFrameRate
Toggle the frame-rate readout the front end shows.
ArmAddRouteLabel(RouteId)
Arm the label tool on this route.
OpenEditor(EditTarget)
Open the in-place editor on this field. A field that is no longer there, or no longer editable, opens nothing.
StampTool
Stamp tool’s default thing at the world point at — what a cell
dragged off the tool cluster and dropped on the canvas comes to
(crate::stamp). Arming and stamping are the cell’s two
gestures, and this is the one that does not arm.
Delete(Deletable)
Copy(Vec<ShapeId>)
Copy the given shapes (and the routes among them) to the clipboard.
CopyPins(Vec<PinId>)
Copy a group of child-block pins to the clipboard (as a pin payload).
Cut(Vec<ShapeId>)
Copy the given shapes to the clipboard, then delete them (one undo step).
CutPins(Vec<PinId>)
Copy a group of child-block pins to the clipboard, then delete them.
SetPinTags
Set every listed pin’s tag to tags.
SetShapeTagHidden
Set a selected shape’s own label — a child block’s tag, or a port’s pin
tag — to tags.
FlipShapePins(ShapeId)
Flip a selected shape’s pins to the opposite edge — a port’s single pin, or all of a child block’s pins — and re-route.
FlipBlockVertical(BlockId)
Vertically mirror a selected child block’s pins — a pin near the top moves to the bottom and vice versa, each keeping its East/West side — and re-route. Scoped to blocks (ports carry a single pin, nothing to mirror).
SetBlockLocked
Lock or unlock a child block: a locked block keeps its pin/port interface frozen (no rename/retype/tag/add/delete of pins or ports) while still allowing whole-block moves, deletes, resizes, and aesthetic edits.
Paste(String)
Paste a clipboard JSON payload into the current level.
ExpandBlock(BlockId)
Zoom(ZoomStep)
Step the zoom in or out about the pointer — the keyboard’s zoom, where the wheel zooms about the cursor continuously.
GoToPath(BlockPath)
Navigate to a level by its whole path — the palette’s go <path>,
which parses a content-path string (see crate::content_path).
SetRole
Accent target — what the picker reports, rather than what it writes.
A popup that wrote the document itself was the only mutation in the
app reachable by no other route, and so the only one no test could
drive; as an action it dispatches like every other write and a script
can ask for it by name.
Fields
target: RoleTargetSetPinsKind
Set the I/O direction of every listed pin — the pin-type picker’s
report, on the same terms as Action::SetRole.
GoUp
AcknowledgeFailure(usize)
The user is done with one of the session’s failure notices, named by its position among them.
FrameRect(Rect)
Frame this world rect — the palette’s camera <x> <y> <w> <h>, the
same framing a scripted camera step applies.
Select a block chosen in the navigation dialog: replace the selection (or,
with extend, toggle it into the current selection like a canvas
shift-click), then pan/zoom the canvas to frame that block.
Undo
Restore the previous document/navigation snapshot.
Redo
Re-apply a snapshot undone by Action::Undo.
Nudge
Arrow-key move of the current selection: shapes shift by (dx, dy) grid
cells; a pin selection shifts by dy slots (dx ignored).
ResetView
Reset zoom/pan so the whole document fits in the viewport.
Export
Export what is on the canvas in format — or, when selection names
shapes, those shapes as a standalone diagram. What comes of it is bytes
and a name, handed back through the session’s one hand-off slot; which
file they are written to is the host’s own business.
SetIcon
Wear this artwork as the block’s foreground icon.
PlaceImage
Draw this artwork as an image of its own. Where it goes is the session’s to say — the picker the shell ran knows nothing about the canvas — so it lands centred on the point a paste lands on, at the artwork’s own aspect.
Reroute(RouteId)
Rip up a route and autoroute it fresh with no waypoints.
RerouteBlock(BlockId)
Rip up and autoroute every route with an endpoint on this block.
ViewRev(Rev)
Put a past rev on the canvas, read-only — the time machine.
ViewHead
Leave the past for the writable head.
SetPalette(Palette)
Paint the drawing in this palette from now on — the front end’s theme, told. Not an edit: it spends no rev, the undo stack does not move, and a read-only session takes it.
TagRev
Put a name on a rev, or take one off. Not an edit: it spends no rev and the undo stack does not move.
Implementations§
Source§impl Action
impl Action
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
What the commit this action produces is called — the stable command name where a named command triggered it, so the log, undo, and review all read the same word for the same gesture. Actions that write nothing still carry one: the gesture opens before the dispatcher knows which arm will take it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Action> for Transition
impl From<Action> for Transition
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more