pub struct RuntimeHookConfig {
pub pre_hooks: Vec<Arc<dyn PreHook>>,
pub post_hooks: Vec<Arc<dyn PostHook>>,
pub pre_tool_use_hooks: Vec<Arc<dyn PreHook>>,
}Fields§
§pre_hooks: Vec<Arc<dyn PreHook>>§post_hooks: Vec<Arc<dyn PostHook>>§pre_tool_use_hooks: Vec<Arc<dyn PreHook>>Hooks that fire specifically for PreToolUse phase via the internal approval loop. When non-empty, the runtime manages the approval channel internally and auto-escalates ApprovalPolicy from Never → Untrusted so codex sends approval requests.
Implementations§
Source§impl RuntimeHookConfig
impl RuntimeHookConfig
Sourcepub fn with_pre_hook(self, hook: Arc<dyn PreHook>) -> Self
pub fn with_pre_hook(self, hook: Arc<dyn PreHook>) -> Self
Register one pre hook. Allocation: amortized O(1) push. Complexity: O(1).
Sourcepub fn with_post_hook(self, hook: Arc<dyn PostHook>) -> Self
pub fn with_post_hook(self, hook: Arc<dyn PostHook>) -> Self
Register one post hook. Allocation: amortized O(1) push. Complexity: O(1).
Sourcepub fn with_pre_tool_use_hook(self, hook: Arc<dyn PreHook>) -> Self
pub fn with_pre_tool_use_hook(self, hook: Arc<dyn PreHook>) -> Self
Register one pre-tool-use hook (fires in PreToolUse phase via the approval loop). Allocation: amortized O(1) push. Complexity: O(1).
Sourcepub fn has_pre_tool_use_hooks(&self) -> bool
pub fn has_pre_tool_use_hooks(&self) -> bool
True when at least one tool-use hook is registered. Allocation: none. Complexity: O(1).
Trait Implementations§
Source§impl Clone for RuntimeHookConfig
impl Clone for RuntimeHookConfig
Source§fn clone(&self) -> RuntimeHookConfig
fn clone(&self) -> RuntimeHookConfig
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 RuntimeHookConfig
impl Debug for RuntimeHookConfig
Source§impl Default for RuntimeHookConfig
impl Default for RuntimeHookConfig
Source§fn default() -> RuntimeHookConfig
fn default() -> RuntimeHookConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for RuntimeHookConfig
impl PartialEq for RuntimeHookConfig
impl Eq for RuntimeHookConfig
Auto Trait Implementations§
impl Freeze for RuntimeHookConfig
impl !RefUnwindSafe for RuntimeHookConfig
impl Send for RuntimeHookConfig
impl Sync for RuntimeHookConfig
impl Unpin for RuntimeHookConfig
impl UnsafeUnpin for RuntimeHookConfig
impl !UnwindSafe for RuntimeHookConfig
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