pub struct AutoPromptHandler { /* private fields */ }Expand description
Handler that automatically approves/denies based on configuration
Implementations§
Source§impl AutoPromptHandler
impl AutoPromptHandler
Sourcepub fn always_allow() -> Self
pub fn always_allow() -> Self
Create handler that always approves
Sourcepub fn always_deny() -> Self
pub fn always_deny() -> Self
Create handler that always denies
Sourcepub fn with_response(response: PromptResult) -> Self
pub fn with_response(response: PromptResult) -> Self
Create handler with custom default response
Trait Implementations§
Source§impl Debug for AutoPromptHandler
impl Debug for AutoPromptHandler
Source§impl PromptHandler for AutoPromptHandler
impl PromptHandler for AutoPromptHandler
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 AutoPromptHandler
impl RefUnwindSafe for AutoPromptHandler
impl Send for AutoPromptHandler
impl Sync for AutoPromptHandler
impl Unpin for AutoPromptHandler
impl UnwindSafe for AutoPromptHandler
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