pub struct Hooks { /* private fields */ }Implementations§
Source§impl Hooks
impl Hooks
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn has_phase(&self, phase: HookPhase) -> bool
pub fn phases(&self) -> impl Iterator<Item = HookPhase> + '_
pub fn append(self, other: Hooks) -> Self
pub fn pre_dispatch<F>(self, f: F) -> Self
pub fn post_dispatch<F>(self, f: F) -> Self
pub fn post_output<F>(self, f: F) -> Selfwhere
F: Fn(&ArgMatches, &CommandContext, RenderedOutput) -> Result<RenderedOutput, HookError> + 'static,
pub fn run_pre_dispatch( &self, matches: &ArgMatches, ctx: &mut CommandContext, ) -> Result<(), HookError>
pub fn run_post_dispatch( &self, matches: &ArgMatches, ctx: &CommandContext, data: Value, ) -> Result<Value, HookError>
pub fn run_post_output( &self, matches: &ArgMatches, ctx: &CommandContext, output: RenderedOutput, ) -> Result<RenderedOutput, HookError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Hooks
impl !Send for Hooks
impl !Sync for Hooks
impl !UnwindSafe for Hooks
impl Freeze for Hooks
impl Unpin for Hooks
impl UnsafeUnpin for Hooks
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