Struct inquire::MultiSelect

source ·
pub struct MultiSelect<'a, T> {
    pub message: &'a str,
    pub options: Vec<T>,
    pub default: Option<&'a [usize]>,
    pub help_message: Option<&'a str>,
    pub page_size: usize,
    pub vim_mode: bool,
    pub starting_cursor: usize,
    pub filter: Filter<'a, T>,
    pub keep_filter: bool,
    pub formatter: MultiOptionFormatter<'a, T>,
    pub validator: Option<Box<dyn MultiOptionValidator<T>>>,
    pub render_config: RenderConfig,
}
Expand description

Prompt suitable for when you need the user to select many options (including none if applicable) among a list of them.

The user can select (or deselect) the current highlighted option by pressing space, clean all selections by pressing the left arrow and select all options by pressing the right arrow.

This prompt requires a prompt message and a non-empty Vec of options to be displayed to the user. The options can be of any type as long as they implement the Display trait. It is required that the Vec is moved to the prompt, as the prompt will return the ownership of the Vec after the user submits, with only the selected options inside it.

  • If the list is empty, the prompt operation will fail with an InquireError::InvalidConfiguration error.

The options are paginated in order to provide a smooth experience to the user, with the default page size being 7. The user can move from the options and the pages will be updated accordingly, including moving from the last to the first options (or vice-versa).

Customizable options:

  • Prompt message: Required when creating the prompt.
  • Options list: Options displayed to the user. Must be non-empty.
  • Default selections: Options that are selected by default when the prompt is first rendered. The user can unselect them. If any of the indices is out-of-range of the option list, the prompt will fail with an InquireError::InvalidConfiguration error.
  • Starting cursor: Index of the cursor when the prompt is first rendered. Default is 0 (first option). If the index is out-of-range of the option list, the prompt will fail with an InquireError::InvalidConfiguration error.
  • Help message: Message displayed at the line below the prompt.
  • Formatter: Custom formatter in case you need to pre-process the user input before showing it as the final answer.
    • Prints the selected options string value, joined using a comma as the separator, by default.
  • Validator: Custom validator to make sure a given submitted input pass the specified requirements, e.g. not allowing 0 selected options or limiting the number of options that the user is allowed to select.
    • No validators are on by default.
  • Page size: Number of options displayed at once, 7 by default.
  • Display option indexes: On long lists, it might be helpful to display the indexes of the options to the user. Via the RenderConfig, you can set the display mode of the indexes as a prefix of an option. The default configuration is None, to not render any index when displaying the options.
  • Filter function: Function that defines if an option is displayed or not based on the current filter input.
  • Keep filter flag: Whether the current filter input should be cleared or not after a selection is made. Defaults to true.

Example

For a full-featured example, check the GitHub repository.

Fields§

§message: &'a str

Message to be presented to the user.

§options: Vec<T>

Options displayed to the user.

§default: Option<&'a [usize]>

Default indexes of options to be selected from the start.

§help_message: Option<&'a str>

Help message to be presented to the user.

§page_size: usize

Page size of the options displayed to the user.

§vim_mode: bool

Whether vim mode is enabled. When enabled, the user can navigate through the options using hjkl.

§starting_cursor: usize

Starting cursor index of the selection.

§filter: Filter<'a, T>

Function called with the current user input to filter the provided options.

§keep_filter: bool

Whether the current filter typed by the user is kept or cleaned after a selection is made.

§formatter: MultiOptionFormatter<'a, T>

Function that formats the user input and presents it to the user as the final rendering of the prompt.

§validator: Option<Box<dyn MultiOptionValidator<T>>>

Validator to apply to the user input.

In case of error, the message is displayed one line above the prompt.

§render_config: RenderConfig

RenderConfig to apply to the rendered interface.

Note: The default render config considers if the NO_COLOR environment variable is set to decide whether to render the colored config or the empty one.

When overriding the config in a prompt, NO_COLOR is no longer considered and your config is treated as the only source of truth. If you want to customize colors and still suport NO_COLOR, you will have to do this on your end.

Implementations§

String formatter used by default in MultiSelect prompts. Prints the string value of all selected options, separated by commas.

Examples
use inquire::list_option::ListOption;
use inquire::MultiSelect;

let formatter = MultiSelect::<&str>::DEFAULT_FORMATTER;

let mut ans = vec![ListOption::new(0, &"New York")];
assert_eq!(String::from("New York"), formatter(&ans));

ans.push(ListOption::new(3, &"Seattle"));
assert_eq!(String::from("New York, Seattle"), formatter(&ans));

ans.push(ListOption::new(7, &"Vancouver"));
assert_eq!(String::from("New York, Seattle, Vancouver"), formatter(&ans));

Default filter function, which checks if the current filter value is a substring of the option value. If it is, the option is displayed.

Examples
use inquire::MultiSelect;

let filter = MultiSelect::<&str>::DEFAULT_FILTER;
assert_eq!(false, filter("sa", &"New York",      "New York",      0));
assert_eq!(true,  filter("sa", &"Sacramento",    "Sacramento",    1));
assert_eq!(true,  filter("sa", &"Kansas",        "Kansas",        2));
assert_eq!(true,  filter("sa", &"Mesa",          "Mesa",          3));
assert_eq!(false, filter("sa", &"Phoenix",       "Phoenix",       4));
assert_eq!(false, filter("sa", &"Philadelphia",  "Philadelphia",  5));
assert_eq!(true,  filter("sa", &"San Antonio",   "San Antonio",   6));
assert_eq!(true,  filter("sa", &"San Diego",     "San Diego",     7));
assert_eq!(false, filter("sa", &"Dallas",        "Dallas",        8));
assert_eq!(true,  filter("sa", &"San Francisco", "San Francisco", 9));
assert_eq!(false, filter("sa", &"Austin",        "Austin",       10));
assert_eq!(false, filter("sa", &"Jacksonville",  "Jacksonville", 11));
assert_eq!(true,  filter("sa", &"San Jose",      "San Jose",     12));

Default page size, equal to the global default page size [config::DEFAULT_PAGE_SIZE]

Default value of vim mode, equal to the global default value [config::DEFAULT_PAGE_SIZE]

Default starting cursor index.

Default behavior of keeping or cleaning the current filter value.

Default help message.

Creates a MultiSelect with the provided message and options, along with default configuration values.

Examples found in repository?
examples/multiselect.rs (line 35)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main() {
    let options = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];

    let validator = |a: &[ListOption<&&str>]| {
        if a.len() < 2 {
            return Ok(Validation::Invalid("This list is too small!".into()));
        }

        let x = a.iter().any(|o| *o.value == "Pineapple");

        match x {
            true => Ok(Validation::Valid),
            false => Ok(Validation::Invalid("Remember to buy pineapples".into())),
        }
    };

    let formatter: MultiOptionFormatter<&str> = &|a| format!("{} different fruits", a.len());

    let ans = MultiSelect::new("Select the fruits for your shopping list:", options)
        .with_validator(validator)
        .with_formatter(formatter)
        .prompt();

    match ans {
        Ok(_) => println!("I'll get right on it"),
        Err(_) => println!("The shopping list could not be processed"),
    }
}
More examples
Hide additional examples
examples/expense_tracker.rs (line 36)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> InquireResult<()> {
    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!("The balance of {} is now ${:.2}", account, account.balance);

    Ok(())
}
examples/empty_render_config.rs (line 40)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
fn main() -> InquireResult<()> {
    inquire::set_global_render_config(RenderConfig::empty());

    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!("The balance of {} is now $311.09", account);

    Ok(())
}
examples/render_config.rs (line 40)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
fn main() -> InquireResult<()> {
    inquire::set_global_render_config(get_render_config());

    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!(
        "The balance of {} is now ${:.2}",
        account.name, account.balance
    );

    Ok(())
}
examples/form.rs (line 38)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
fn main() -> InquireResult<()> {
    let fruits = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];
    let pineapple_index = fruits.len() - 1;

    let languages = vec![
        "C++",
        "Rust",
        "C",
        "Python",
        "Java",
        "TypeScript",
        "JavaScript",
        "Go",
    ];

    let _workplace = Text::new("Where do you work?")
        .with_help_message("Don't worry, this will not be sold to third-party advertisers.")
        .with_validator(min_length!(5, "Minimum of 5 characters"))
        .with_default("Unemployed")
        .prompt_skippable()?;

    let _eats_pineapple = MultiSelect::new("What are your favorite fruits?", fruits)
        .raw_prompt()?
        .into_iter()
        .any(|o| o.index == pineapple_index);

    let _eats_pizza = Confirm::new("Do you eat pizza?")
        .with_default(true)
        .prompt_skippable()?;

    let _language =
        Select::new("What is your favorite programming language?", languages).prompt_skippable()?;

    let _password = Password::new("Password:")
        .with_validator(min_length!(8, "Minimum of 8 characters"))
        .prompt_skippable()?;

    let _when = DateSelect::new("When are you going to travel?").prompt_skippable()?;

    println!("Based on our ML-powered analysis, we were able to conclude absolutely nothing.");

    Ok(())
}

Sets the help message of the prompt.

Removes the set help message.

Sets the page size.

Enables or disables vim_mode.

Sets the keep filter behavior.

Sets the filter function.

Sets the formatter.

Examples found in repository?
examples/multiselect.rs (line 37)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main() {
    let options = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];

    let validator = |a: &[ListOption<&&str>]| {
        if a.len() < 2 {
            return Ok(Validation::Invalid("This list is too small!".into()));
        }

        let x = a.iter().any(|o| *o.value == "Pineapple");

        match x {
            true => Ok(Validation::Valid),
            false => Ok(Validation::Invalid("Remember to buy pineapples".into())),
        }
    };

    let formatter: MultiOptionFormatter<&str> = &|a| format!("{} different fruits", a.len());

    let ans = MultiSelect::new("Select the fruits for your shopping list:", options)
        .with_validator(validator)
        .with_formatter(formatter)
        .prompt();

    match ans {
        Ok(_) => println!("I'll get right on it"),
        Err(_) => println!("The shopping list could not be processed"),
    }
}

Sets the validator to apply to the user input. You might want to use this feature in case you need to limit the user to specific choices, such as limiting the number of selections.

In case of error, the message is displayed one line above the prompt.

Examples found in repository?
examples/multiselect.rs (line 36)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main() {
    let options = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];

    let validator = |a: &[ListOption<&&str>]| {
        if a.len() < 2 {
            return Ok(Validation::Invalid("This list is too small!".into()));
        }

        let x = a.iter().any(|o| *o.value == "Pineapple");

        match x {
            true => Ok(Validation::Valid),
            false => Ok(Validation::Invalid("Remember to buy pineapples".into())),
        }
    };

    let formatter: MultiOptionFormatter<&str> = &|a| format!("{} different fruits", a.len());

    let ans = MultiSelect::new("Select the fruits for your shopping list:", options)
        .with_validator(validator)
        .with_formatter(formatter)
        .prompt();

    match ans {
        Ok(_) => println!("I'll get right on it"),
        Err(_) => println!("The shopping list could not be processed"),
    }
}

Sets the indexes to be selected by the default.

Sets the starting cursor index.

Sets the provided color theme to this prompt.

Note: The default render config considers if the NO_COLOR environment variable is set to decide whether to render the colored config or the empty one.

When overriding the config in a prompt, NO_COLOR is no longer considered and your config is treated as the only source of truth. If you want to customize colors and still suport NO_COLOR, you will have to do this on your end.

Parses the provided behavioral and rendering options and prompts the CLI user for input according to the defined rules.

Returns the owned objects selected by the user.

This method is intended for flows where the user skipping/cancelling the prompt - by pressing ESC - is considered normal behavior. In this case, it does not return Err(InquireError::OperationCanceled), but Ok(None).

Meanwhile, if the user does submit an answer, the method wraps the return type with Some.

Parses the provided behavioral and rendering options and prompts the CLI user for input according to the defined rules.

Returns the owned objects selected by the user.

Examples found in repository?
examples/multiselect.rs (line 38)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
fn main() {
    let options = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];

    let validator = |a: &[ListOption<&&str>]| {
        if a.len() < 2 {
            return Ok(Validation::Invalid("This list is too small!".into()));
        }

        let x = a.iter().any(|o| *o.value == "Pineapple");

        match x {
            true => Ok(Validation::Valid),
            false => Ok(Validation::Invalid("Remember to buy pineapples".into())),
        }
    };

    let formatter: MultiOptionFormatter<&str> = &|a| format!("{} different fruits", a.len());

    let ans = MultiSelect::new("Select the fruits for your shopping list:", options)
        .with_validator(validator)
        .with_formatter(formatter)
        .prompt();

    match ans {
        Ok(_) => println!("I'll get right on it"),
        Err(_) => println!("The shopping list could not be processed"),
    }
}
More examples
Hide additional examples
examples/expense_tracker.rs (line 36)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> InquireResult<()> {
    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!("The balance of {} is now ${:.2}", account, account.balance);

    Ok(())
}
examples/empty_render_config.rs (line 40)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
fn main() -> InquireResult<()> {
    inquire::set_global_render_config(RenderConfig::empty());

    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!("The balance of {} is now $311.09", account);

    Ok(())
}
examples/render_config.rs (line 40)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
fn main() -> InquireResult<()> {
    inquire::set_global_render_config(get_render_config());

    let _date = DateSelect::new("Date:").prompt()?;

    let _category = Select::new("Category:", get_categories()).prompt()?;

    let _payee = Text::new("Payee:")
        .with_validator(required!("This field is required"))
        .with_autocomplete(&payee_suggestor)
        .with_help_message("e.g. Music Store")
        .with_page_size(5)
        .prompt()?;

    let amount: f64 = CustomType::new("Amount:")
        .with_formatter(&|i: f64| format!("${}", i))
        .with_error_message("Please type a valid number")
        .with_help_message("Type the amount in US dollars using a decimal point as a separator")
        .prompt()
        .unwrap();

    let _description = Text::new("Description:")
        .with_help_message("Optional notes")
        .prompt()?;

    let mut accounts = get_accounts();
    let accounts_mut = accounts.iter_mut().collect();
    let account = Select::new("Account:", accounts_mut).prompt()?;
    account.balance -= amount;

    let _tags = MultiSelect::new("Tags:", get_tags()).prompt()?;

    println!("Your transaction has been successfully recorded.");
    println!(
        "The balance of {} is now ${:.2}",
        account.name, account.balance
    );

    Ok(())
}

Parses the provided behavioral and rendering options and prompts the CLI user for input according to the defined rules.

Returns a vector of ListOptions containing the index of the selections and the owned objects selected by the user.

This method is intended for flows where the user skipping/cancelling the prompt - by pressing ESC - is considered normal behavior. In this case, it does not return Err(InquireError::OperationCanceled), but Ok(None).

Meanwhile, if the user does submit an answer, the method wraps the return type with Some.

Parses the provided behavioral and rendering options and prompts the CLI user for input according to the defined rules.

Returns a ListOption containing the index of the selection and the owned object selected by the user.

Examples found in repository?
examples/form.rs (line 39)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
fn main() -> InquireResult<()> {
    let fruits = vec![
        "Banana",
        "Apple",
        "Strawberry",
        "Grapes",
        "Lemon",
        "Tangerine",
        "Watermelon",
        "Orange",
        "Pear",
        "Avocado",
        "Pineapple",
    ];
    let pineapple_index = fruits.len() - 1;

    let languages = vec![
        "C++",
        "Rust",
        "C",
        "Python",
        "Java",
        "TypeScript",
        "JavaScript",
        "Go",
    ];

    let _workplace = Text::new("Where do you work?")
        .with_help_message("Don't worry, this will not be sold to third-party advertisers.")
        .with_validator(min_length!(5, "Minimum of 5 characters"))
        .with_default("Unemployed")
        .prompt_skippable()?;

    let _eats_pineapple = MultiSelect::new("What are your favorite fruits?", fruits)
        .raw_prompt()?
        .into_iter()
        .any(|o| o.index == pineapple_index);

    let _eats_pizza = Confirm::new("Do you eat pizza?")
        .with_default(true)
        .prompt_skippable()?;

    let _language =
        Select::new("What is your favorite programming language?", languages).prompt_skippable()?;

    let _password = Password::new("Password:")
        .with_validator(min_length!(8, "Minimum of 8 characters"))
        .prompt_skippable()?;

    let _when = DateSelect::new("When are you going to travel?").prompt_skippable()?;

    println!("Based on our ML-powered analysis, we were able to conclude absolutely nothing.");

    Ok(())
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.