pub struct Object { /* private fields */ }
Implementations§
Source§impl Object
impl Object
pub fn new(message: String, api: &OpenAPI, schema: ObjectType) -> Self
pub fn with_formatter( &mut self, formatter: impl ObjectFormatter + 'static, ) -> &mut Self
pub fn with_value(&mut self, value: IndexMap<String, Value>) -> &mut Self
Trait Implementations§
Source§impl Prompt for Object
impl Prompt for Object
Source§fn setup(&mut self) -> Result<(), Error>
fn setup(&mut self) -> Result<(), Error>
Sets up the prompt.
A lifecycle method for validating and initializing settings.
A lifecycle method for validating and initializing settings.
Source§fn handle(&mut self, code: KeyCode, modifiers: KeyModifiers) -> PromptState
fn handle(&mut self, code: KeyCode, modifiers: KeyModifiers) -> PromptState
Handles key presses.
Allows changing the internal state of the prompt in response to key inputs.
Allows changing the internal state of the prompt in response to key inputs.
Source§fn submit(&mut self) -> Self::Output
fn submit(&mut self) -> Self::Output
Submits the prompt.
Called as a result of
Called as a result of
Prompt::handle
returning PromptState::Submit
, it returns the final value.Source§fn render(&mut self, state: &PromptState) -> Result<RenderPayload, String>
fn render(&mut self, state: &PromptState) -> Result<RenderPayload, String>
Renders the prompt.
Performs rendering based on the value of
If returning an error, please return the error message as a
Performs rendering based on the value of
PromptState
.If returning an error, please return the error message as a
String
.Auto Trait Implementations§
impl Freeze for Object
impl !RefUnwindSafe for Object
impl !Send for Object
impl !Sync for Object
impl Unpin for Object
impl !UnwindSafe for Object
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