pub struct RecordingPromptHandler { /* private fields */ }Expand description
Handler that records prompts for testing
Implementations§
Source§impl RecordingPromptHandler
impl RecordingPromptHandler
Sourcepub fn new(response: PromptResult) -> Self
pub fn new(response: PromptResult) -> Self
Create a new recording handler
Sourcepub fn prompts(&self) -> Vec<RecordedPrompt>
pub fn prompts(&self) -> Vec<RecordedPrompt>
Get all recorded prompts
Sourcepub fn prompt_count(&self) -> usize
pub fn prompt_count(&self) -> usize
Get the number of prompts
Trait Implementations§
Source§impl Debug for RecordingPromptHandler
impl Debug for RecordingPromptHandler
Source§impl Default for RecordingPromptHandler
impl Default for RecordingPromptHandler
Source§fn default() -> RecordingPromptHandler
fn default() -> RecordingPromptHandler
Returns the “default value” for a type. Read more
Source§impl PromptHandler for RecordingPromptHandler
impl PromptHandler for RecordingPromptHandler
Source§fn prompt(
&self,
plugin: &str,
capabilities: &Capabilities,
) -> Result<PromptResult, PromptError>
fn prompt( &self, plugin: &str, capabilities: &Capabilities, ) -> Result<PromptResult, PromptError>
Display a permission prompt and get user’s decision
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this handler supports interactive prompts
Source§fn prompt_escalation(
&self,
plugin: &str,
_old_caps: &Capabilities,
new_caps: &Capabilities,
) -> Result<PromptResult, PromptError>
fn prompt_escalation( &self, plugin: &str, _old_caps: &Capabilities, new_caps: &Capabilities, ) -> Result<PromptResult, PromptError>
Display an escalation warning and get user’s decision
Auto Trait Implementations§
impl !Freeze for RecordingPromptHandler
impl RefUnwindSafe for RecordingPromptHandler
impl Send for RecordingPromptHandler
impl Sync for RecordingPromptHandler
impl Unpin for RecordingPromptHandler
impl UnwindSafe for RecordingPromptHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more