pub struct Prompt {
pub info: Prompt,
pub handler: Box<dyn PromptHandler>,
pub enabled: bool,
}
Expand description
A registered prompt with its handler
Fields§
§info: Prompt
Information about the prompt
handler: Box<dyn PromptHandler>
Handler that implements the prompt’s functionality
enabled: bool
Whether the prompt is currently enabled
Implementations§
Source§impl Prompt
impl Prompt
Sourcepub fn new<H>(info: PromptInfo, handler: H) -> Selfwhere
H: PromptHandler + 'static,
pub fn new<H>(info: PromptInfo, handler: H) -> Selfwhere
H: PromptHandler + 'static,
Create a new prompt with the given information and handler
§Arguments
info
- Information about the prompthandler
- Implementation of the prompt’s functionality
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if the prompt is enabled
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prompt
impl !RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl !UnwindSafe for Prompt
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