pub struct ScriptHook { /* private fields */ }Expand description
One config-driven lifecycle script executed by an installed system runtime.
Scripts receive Bamboo’s versioned hook envelope on stdin and emit the same JSON response protocol as command hooks on stdout.
Implementations§
Source§impl ScriptHook
impl ScriptHook
pub fn new( event: LifecycleHookEvent, path: impl Into<String>, runner: LifecycleScriptRunner, timeout_ms: u64, matcher: Option<&str>, fallback_cwd: Option<PathBuf>, sequence: usize, ) -> Result<ScriptHook, Error>
Trait Implementations§
Source§impl AgentHook for ScriptHook
impl AgentHook for ScriptHook
Source§fn point(&self) -> AgentHookPoint
fn point(&self) -> AgentHookPoint
Which hook point this hook subscribes to.
Source§fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_point: AgentHookPoint,
payload: &'life1 HookPayload,
session: &'life2 Session,
) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ScriptHook: 'async_trait,
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_point: AgentHookPoint,
payload: &'life1 HookPayload,
session: &'life2 Session,
) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
ScriptHook: 'async_trait,
Execute the hook. Read more
Source§fn matches(&self, payload: &HookPayload) -> bool
fn matches(&self, payload: &HookPayload) -> bool
Whether this hook applies to the point-specific payload. Read more
Source§fn may_suspend(&self) -> bool
fn may_suspend(&self) -> bool
Whether this hook can request a resumable suspension. Unknown native
hooks conservatively can. Hosts may declare a hook non-suspending only
when it never returns
Suspend; violating that declaration aborts the
operation rather than creating a wait. The declaration is frozen at
registration. Allow/Deny/Ask remain independent.Auto Trait Implementations§
impl Freeze for ScriptHook
impl RefUnwindSafe for ScriptHook
impl Send for ScriptHook
impl Sync for ScriptHook
impl Unpin for ScriptHook
impl UnsafeUnpin for ScriptHook
impl UnwindSafe for ScriptHook
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