[][src]Trait ibuilder::BuildableValue

pub trait BuildableValue: Debug {
    fn apply(
        &mut self,
        data: &str,
        current_fields: &[String]
    ) -> Result<(), ChooseError>;
fn get_options(&self, current_fields: &[String]) -> Options;
fn get_subfields(&self, current_fields: &[String]) -> Vec<String>;
fn to_node(&self) -> Node;
fn get_value_any(&self) -> Option<Box<dyn Any>>; }

The interactive builder for a base type.

Required methods

fn apply(
    &mut self,
    data: &str,
    current_fields: &[String]
) -> Result<(), ChooseError>

Try to change the inner value using the provided string.

fn get_options(&self, current_fields: &[String]) -> Options

The options to show to the user for setting this value.

fn get_subfields(&self, current_fields: &[String]) -> Vec<String>

Whether this value contains itself other values (i.e. it's a struct).

fn to_node(&self) -> Node

Create the tree structure of this value.

fn get_value_any(&self) -> Option<Box<dyn Any>>

Get the inner value, if present, as an Any.

It's very important that the returned Any internal type matches the type that this builder is used for. The Builder will downcast this Any to the types it's expecting, panicking in case of mismatched type.

Loading content...

Implementors

impl BuildableValue for BoolBuilder[src]

impl BuildableValue for CharBuilder[src]

impl BuildableValue for F32Builder[src]

impl BuildableValue for F64Builder[src]

impl BuildableValue for I16Builder[src]

impl BuildableValue for I32Builder[src]

impl BuildableValue for I64Builder[src]

impl BuildableValue for I8Builder[src]

impl BuildableValue for IsizeBuilder[src]

impl BuildableValue for StringBuilder[src]

impl BuildableValue for U16Builder[src]

impl BuildableValue for U32Builder[src]

impl BuildableValue for U64Builder[src]

impl BuildableValue for U8Builder[src]

impl BuildableValue for UsizeBuilder[src]

impl<T> BuildableValue for BoxBuilder<T> where
    T: NewBuildableValue + 'static, 
[src]

impl<T> BuildableValue for VecBuilder<T> where
    T: NewBuildableValue + 'static, 
[src]

Loading content...