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

Method new

std/src/storage/cmds.rs:142–157  ·  view source on GitHub ↗

Creates a new `CD` command that changes the current location in `storage`.

(storage: Rc<RefCell<Storage>>)

Source from the content-addressed store, hash-verified

140impl CdCommand {
141 /// Creates a new `CD` command that changes the current location in `storage`.
142 pub fn new(storage: Rc<RefCell<Storage>>) -> Rc<Self> {
143 Rc::from(Self {
144 metadata: CallableMetadataBuilder::new("CD")
145 .with_syntax(&[(
146 &[SingularArgSyntax::RequiredValue(
147 RequiredValueSyntax { name: Cow::Borrowed("path"), vtype: ExprType::Text },
148 ArgSepSyntax::End,
149 )],
150 None,
151 )])
152 .with_category(CATEGORY)
153 .with_description("Changes the current path.")
154 .build(),
155 storage,
156 })
157 }
158}
159
160#[async_trait(?Send)]

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected