MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/exec.rs:39–57  ·  view source on GitHub ↗

Creates a new `CLEAR` command that resets the state of the machine.

(actions: Rc<RefCell<Vec<MachineAction>>>)

Source from the content-addressed store, hash-verified

37impl ClearCommand {
38 /// Creates a new `CLEAR` command that resets the state of the machine.
39 pub fn new(actions: Rc<RefCell<Vec<MachineAction>>>) -> Rc<Self> {
40 Rc::from(Self {
41 metadata: CallableMetadataBuilder::new("CLEAR")
42 .with_async(true)
43 .with_syntax(&[(&[], None)])
44 .with_category(CATEGORY)
45 .with_description(
46 "Restores initial machine state but keeps the stored program.
47This command resets the machine to a semi-pristine state by clearing all user-defined variables \
48and restoring the state of shared resources. These resources include: the console, whose color \
49and video syncing bit are reset; and the GPIO pins, which are set to their default state.
50The stored program is kept in memory. To clear that too, use NEW (but don't forget to first \
51SAVE your program!).
52This command is for interactive use only.",
53 )
54 .build(),
55 actions,
56 })
57 }
58}
59
60#[async_trait(?Send)]

Callers

nothing calls this directly

Calls 6

with_descriptionMethod · 0.80
with_categoryMethod · 0.80
with_syntaxMethod · 0.80
with_asyncMethod · 0.80
with_return_typeMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected