pub struct HookResult {
pub exit_code: i32,
pub stdout: String,
pub stderr: String,
pub timed_out: bool,
pub error: Option<String>,
}Expand description
Result from executing a single hook command.
Fields§
§exit_code: i32Process exit code (0 = success, 2 = block).
stdout: StringCaptured stdout.
stderr: StringCaptured stderr.
timed_out: boolWhether the command timed out.
error: Option<String>Error message if the command failed to execute.
Implementations§
Source§impl HookResult
impl HookResult
Sourcepub fn should_block(&self) -> bool
pub fn should_block(&self) -> bool
Hook requests blocking the operation (exit code 2).
Sourcepub fn parse_json_output(&self) -> HashMap<String, Value>
pub fn parse_json_output(&self) -> HashMap<String, Value>
Parse stdout as a JSON object.
Returns an empty map if stdout is empty or not valid JSON.
Trait Implementations§
Source§impl Clone for HookResult
impl Clone for HookResult
Source§fn clone(&self) -> HookResult
fn clone(&self) -> HookResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookResult
impl Debug for HookResult
Source§impl Default for HookResult
impl Default for HookResult
Source§fn default() -> HookResult
fn default() -> HookResult
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HookResult
impl RefUnwindSafe for HookResult
impl Send for HookResult
impl Sync for HookResult
impl Unpin for HookResult
impl UnsafeUnpin for HookResult
impl UnwindSafe for HookResult
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