Skip to main content

AppScheduleManifest

Struct AppScheduleManifest 

Source
pub struct AppScheduleManifest {
    pub id: String,
    pub cron: String,
    pub capability: String,
    pub payload: Option<Value>,
}
Expand description

One recurring job an app declares in its own manifest, so the host can put the cron row on the node without the app ever having run (econ-v1/node#3185).

Before this existed, an app that records on a schedule had to register its own row when it started — which a lazy app only does once something first invokes it. On a node whose owner never opens that app, the row was never created, nothing was ever recorded, and nothing said so.

Declaring the schedule here does NOT make the app resident. The host registers a CAPABILITY-triggered row pointing at Self::capability; when it fires, the capability router resolves the provider from the registry (seeded at boot for unloaded apps) and cold-starts the app for the duration of the call. Between firings the isolate can be reclaimed exactly as before. auto_start: "auto" would also produce the row, and is NOT the answer: it pins the isolate permanently, which is the cost a sparse cadence exists to avoid.

Fields§

§id: String

Stable identifier, unique within this app. Becomes the cron row’s external_id (paired with the app name as external_type), which is what lets the host find its own row again without storing anything.

Changing it retires the old row and creates a new one — it is an identity, not a label.

§cron: String

6-field cron expression: sec min hour day month weekday.

Checked here only for shape (six non-empty fields over the permitted character set). The authoritative parse lives in the host, which refuses the whole manifest on a bad expression — this crate is the schema contract that app authors compile against, and is deliberately kept to serde alone rather than pulling a cron parser and its date-time dependencies into every app build.

§capability: String

The capability the row dispatches.

MUST be one this same app declares in provides / capabilities.provides, and the manifest is refused otherwise. Without that restriction any manifest could schedule repeated dispatches at any capability on the node — core.lightning.send_payment, say — and a manifest is not a surface the owner reviews.

§payload: Option<Value>

JSON object handed to the capability on each firing. Absent means {}. A non-object payload is refused: every capability on the dispatch path takes an object, and the router stamps caller into it.

Implementations§

Source§

impl AppScheduleManifest

Source

pub fn effective_payload(&self) -> Value

The payload to dispatch with, defaulting to an empty object.

Trait Implementations§

Source§

impl Clone for AppScheduleManifest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppScheduleManifest

Source§

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

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

impl<'de> Deserialize<'de> for AppScheduleManifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for AppScheduleManifest

Source§

impl PartialEq for AppScheduleManifest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AppScheduleManifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AppScheduleManifest

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.