pub struct PromptConfig<'a, 'b, 'c> {
pub simple: &'a str,
pub continued: &'b str,
pub result_prefix: &'c str,
}
Expand description
Configuration for the REPL readline prompt.
Fields§
§simple: &'a str
Basic prompt for start of a new expression.
continued: &'b str
Altered prompt when an expression is not terminated.
result_prefix: &'c str
Prefix for the result of $expression.inspect
. A newline is printed
after the Ruby result.
Implementations§
Source§impl PromptConfig<'_, '_, '_>
impl PromptConfig<'_, '_, '_>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new, default REPL prompt.
§Default configuration
The PromptConfig
is setup with the following literals:
simple
:>>>
continued
:...
result_prefix
:=>
§Examples
let config = PromptConfig {
simple: ">>> ",
continued: "... ",
result_prefix: "=> ",
};
assert_eq!(config, PromptConfig::new());
assert_eq!(config, PromptConfig::default());
Trait Implementations§
Source§impl<'a, 'b, 'c> Clone for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Clone for PromptConfig<'a, 'b, 'c>
Source§fn clone(&self) -> PromptConfig<'a, 'b, 'c>
fn clone(&self) -> PromptConfig<'a, 'b, 'c>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, 'b, 'c> Debug for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Debug for PromptConfig<'a, 'b, 'c>
Source§impl Default for PromptConfig<'_, '_, '_>
impl Default for PromptConfig<'_, '_, '_>
Source§impl<'a, 'b, 'c> Hash for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Hash for PromptConfig<'a, 'b, 'c>
Source§impl<'a, 'b, 'c> Ord for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Ord for PromptConfig<'a, 'b, 'c>
Source§fn cmp(&self, other: &PromptConfig<'a, 'b, 'c>) -> Ordering
fn cmp(&self, other: &PromptConfig<'a, 'b, 'c>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a, 'b, 'c> PartialEq for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> PartialEq for PromptConfig<'a, 'b, 'c>
Source§impl<'a, 'b, 'c> PartialOrd for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> PartialOrd for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Eq for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> StructuralPartialEq for PromptConfig<'a, 'b, 'c>
Auto Trait Implementations§
impl<'a, 'b, 'c> Freeze for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> RefUnwindSafe for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Send for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Sync for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> Unpin for PromptConfig<'a, 'b, 'c>
impl<'a, 'b, 'c> UnwindSafe for PromptConfig<'a, 'b, 'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more