[][src]Struct endbasic_core::eval::CallableMetadataBuilder

pub struct CallableMetadataBuilder { /* fields omitted */ }

Builder pattern for a callable's metadata.

Implementations

impl CallableMetadataBuilder[src]

pub fn new(name: &'static str, return_type: VarType) -> Self[src]

Constructs a new metadata builder with the minimum information necessary.

All code except tests must populate the whole builder with details. This is enforced at construction time, where we only allow some fields to be missing under the test configuration.

pub fn with_syntax(self, syntax: &'static str) -> Self[src]

Sets the syntax specification for this callable. The syntax is provided as a free-form string that is expected to use whatever representation suits the function best.

pub fn with_category(self, category: &'static str) -> Self[src]

Sets the category for this callable. All callables with the same category name will be grouped together in help messages.

pub fn with_description(self, description: &'static str) -> Self[src]

Sets the description for this callable. The description is a collection of paragraphs separated by a single newline character, where the first paragraph is taken as the summary of the description. The summary must be a short sentence that is descriptive enough to be understood without further details. Empty lines (paragraphs) are not allowed.

pub fn build(self) -> CallableMetadata[src]

Generates the final CallableMetadata object, ensuring all values are present.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.