pub struct ScriptDescriptor {
pub name: &'static str,
pub invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>,
pub signature_json: &'static str,
pub signature_hash: u64,
}Expand description
Descriptor for a registered script.
Collected at link time by quark::inventory for #[chronon::script] handlers or
built manually in tests via Self::new.
Fields§
§name: &'static strUnique script name.
invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>Function to invoke the script with deserialized parameters.
signature_json: &'static strJSON schema for parameters (computed at compile time by chronon-macros).
signature_hash: u64Hash of the signature for version checking.
Implementations§
Source§impl ScriptDescriptor
impl ScriptDescriptor
Sourcepub const fn new(
name: &'static str,
invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>,
) -> ScriptDescriptor
pub const fn new( name: &'static str, invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>, ) -> ScriptDescriptor
Create a descriptor with placeholder signature metadata.
Sourcepub const fn with_signature(
name: &'static str,
invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>,
signature_json: &'static str,
signature_hash: u64,
) -> ScriptDescriptor
pub const fn with_signature( name: &'static str, invoke: fn(Box<dyn ScriptContext>, Value) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send>>, signature_json: &'static str, signature_hash: u64, ) -> ScriptDescriptor
Create a descriptor with full signature information.
Trait Implementations§
impl Collect for ScriptDescriptor
Source§impl Debug for ScriptDescriptor
impl Debug for ScriptDescriptor
Source§impl Registrable for ScriptDescriptor
impl Registrable for ScriptDescriptor
Source§fn registry_key(&self) -> &str
fn registry_key(&self) -> &str
Return the unique lookup key used by the registry.
Auto Trait Implementations§
impl Freeze for ScriptDescriptor
impl RefUnwindSafe for ScriptDescriptor
impl Send for ScriptDescriptor
impl Sync for ScriptDescriptor
impl Unpin for ScriptDescriptor
impl UnsafeUnpin for ScriptDescriptor
impl UnwindSafe for ScriptDescriptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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