Skip to main content

ScriptDescriptor

Struct ScriptDescriptor 

Source
pub struct ScriptDescriptor {
    pub name: &'static str,
    pub invoke: InvokeFn,
    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 str

Unique script name.

§invoke: InvokeFn

Function to invoke the script with deserialized parameters.

§signature_json: &'static str

JSON schema for parameters (computed at compile time by chronon-macros).

§signature_hash: u64

Hash of the signature for version checking.

Implementations§

Source§

impl ScriptDescriptor

Source

pub const fn new(name: &'static str, invoke: InvokeFn) -> Self

Create a descriptor with placeholder signature metadata.

Source

pub const fn with_signature( name: &'static str, invoke: InvokeFn, signature_json: &'static str, signature_hash: u64, ) -> Self

Create a descriptor with full signature information.

Trait Implementations§

Source§

impl Collect for ScriptDescriptor

Source§

impl Debug for ScriptDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Registrable for ScriptDescriptor

Source§

fn registry_key(&self) -> &str

Return the unique lookup key used by the registry.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.