pub struct CommitHook;Expand description
KindHook for the immutable commit note kind.
Validates properties.sha (required, 40-hex) and, when present,
properties.parents (array of 40-hex strings). Commits have no lifecycle
and no after_create edge work.
Trait Implementations§
Source§impl Debug for CommitHook
impl Debug for CommitHook
Source§impl Default for CommitHook
impl Default for CommitHook
Source§fn default() -> CommitHook
fn default() -> CommitHook
Returns the “default value” for a type. Read more
Source§impl KindHook for CommitHook
impl KindHook for CommitHook
Source§fn prepare_create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_runtime: &'life1 KhiveRuntime,
args: &'life2 mut Value,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn prepare_create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_runtime: &'life1 KhiveRuntime,
args: &'life2 mut Value,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Mutate args before the storage write. Fill defaults, normalize values,
rearrange user-facing fields into the storage shape expected by the
shared CRUD handler. Read more
Source§fn after_create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_runtime: &'life1 KhiveRuntime,
_id: Uuid,
_args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn after_create<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_runtime: &'life1 KhiveRuntime,
_id: Uuid,
_args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fire side effects after a successful storage write — graph edges,
derived observations, etc. The newly created record’s UUID is passed
so the hook can attach metadata referencing it. Read more
Auto Trait Implementations§
impl Freeze for CommitHook
impl RefUnwindSafe for CommitHook
impl Send for CommitHook
impl Sync for CommitHook
impl Unpin for CommitHook
impl UnsafeUnpin for CommitHook
impl UnwindSafe for CommitHook
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more