pub struct PatternBuilder { /* private fields */ }Expand description
Builder for common before/after pattern configurations.
Implementations§
Source§impl PatternBuilder
impl PatternBuilder
Sourcepub fn with_password_handler(self, password: impl Into<String>) -> Self
pub fn with_password_handler(self, password: impl Into<String>) -> Self
Add a password prompt handler.
Sourcepub fn with_sudo_handler(self, password: impl Into<String>) -> Self
pub fn with_sudo_handler(self, password: impl Into<String>) -> Self
Add a sudo password handler.
Sourcepub fn with_error_pattern(
self,
pattern: Pattern,
message: impl Into<String>,
) -> Self
pub fn with_error_pattern( self, pattern: Pattern, message: impl Into<String>, ) -> Self
Add an error pattern that aborts.
Sourcepub fn with_yes_handler(self) -> Self
pub fn with_yes_handler(self) -> Self
Add a yes/no prompt handler that responds with yes.
Sourcepub fn with_yn_handler(self) -> Self
pub fn with_yn_handler(self) -> Self
Add a y/n prompt handler that responds with y.
Sourcepub fn with_continue_handler(self) -> Self
pub fn with_continue_handler(self) -> Self
Add a continue prompt handler.
Sourcepub fn build(self) -> PatternManager
pub fn build(self) -> PatternManager
Build the pattern manager.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PatternBuilder
impl !RefUnwindSafe for PatternBuilder
impl Send for PatternBuilder
impl Sync for PatternBuilder
impl Unpin for PatternBuilder
impl !UnwindSafe for PatternBuilder
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