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

Method new_with_name

std/src/help.rs:551–575  ·  view source on GitHub ↗

Creates a new instance of the command with a given `name`.

(name: &'static str)

Source from the content-addressed store, hash-verified

549
550 /// Creates a new instance of the command with a given `name`.
551 pub fn new_with_name(name: &'static str) -> Rc<Self> {
552 Rc::from(Self {
553 metadata: CallableMetadataBuilder::new(name)
554 .with_syntax(&[(
555 &[SingularArgSyntax::RequiredValue(
556 RequiredValueSyntax {
557 name: Cow::Borrowed("sample"),
558 vtype: ExprType::Text,
559 },
560 ArgSepSyntax::End,
561 )],
562 None,
563 )])
564 .with_category(
565 "Testing
566This is a sample category for testing.",
567 )
568 .with_description(
569 "This is the blurb.
570First paragraph of the extended description.
571Second paragraph of the extended description.",
572 )
573 .build(),
574 })
575 }
576 }
577
578 #[async_trait(?Send)]

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected