Struct PromptText
pub struct PromptText { /* private fields */ }Expand description
Owned prompt text.
Implementations§
§impl PromptText
impl PromptText
pub fn new(text: impl Into<String>) -> Result<PromptText, PromptTextError>
pub fn new(text: impl Into<String>) -> Result<PromptText, PromptTextError>
Creates prompt text.
§Errors
Returns [PromptTextError::Empty] when text is empty or only whitespace.
pub fn into_string(self) -> String
pub fn into_string(self) -> String
Returns the owned prompt text.
Trait Implementations§
§impl AsRef<str> for PromptText
impl AsRef<str> for PromptText
§impl Clone for PromptText
impl Clone for PromptText
§fn clone(&self) -> PromptText
fn clone(&self) -> PromptText
Returns a duplicate 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 more§impl Debug for PromptText
impl Debug for PromptText
§impl Display for PromptText
impl Display for PromptText
§impl Hash for PromptText
impl Hash for PromptText
§impl PartialEq for PromptText
impl PartialEq for PromptText
impl Eq for PromptText
impl StructuralPartialEq for PromptText
Auto Trait Implementations§
impl Freeze for PromptText
impl RefUnwindSafe for PromptText
impl Send for PromptText
impl Sync for PromptText
impl Unpin for PromptText
impl UnsafeUnpin for PromptText
impl UnwindSafe for PromptText
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