pub trait StringPromptable {
// Required method
fn prompt(output: &str) -> Self;
}
Expand description
A trait that defines prompt functionality for obtaining user input as a String
.
This trait allows any type that implements StringPromptable
to provide a prompt
for user input, making it easier to capture data of type String
.
§Methods
prompt
: Displays a prompt message to the user and returns the input as the type implementing the trait.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.