Expand description
Derives emit trait impls and descriptions only; behaviour lives in the libraries.
Attribute Macros§
- every
- Interval as
30s,15m,1h,1d;each = queryruns it per listed record, one job each. Or a time on a zone’s clock:daily_at = "03:00", zone = "Europe/Istanbul", and withweekly_on = "monday"on that day only. - feature
- Written
#[sofie::feature(FLAG)]: a barefeatureis Rust’s own crate attribute. - job
- Read by
sofie gen, which registers the job with the worker. - on
- Takes no arguments: naming the event again could only disagree with the argument’s type.
Derive Macros§
- Aggregate
#[owner]marks theId<…>field naming the owner; on the struct, a record that is its own owner, or with(through = parent)one owned by its parent’s owner.#[aggregate(behaviors(Slugged(from = name)))]adds behaviors toVersionedandTimestamps. Field constraints are those of#[derive(Input)]. A#[sensitive]field shows as***inDebugand logs; it and one of a sensitive type stay out of JSON and search.- Enum
#[to(…)]lists a variant’s transitions.- Event
- Input
#[min(n)]/#[max(n)]bound text characters or a number’s value;#[length(min, max)],#[range(min, max)],#[required](not blank) and#[unique](held by the database only).#[input(from = Order)]inheritsOrder’s field constraints,#[unconstrained]drops them;#[input(validate)]runsValidateafter them.- Read
Model #[read(from = Aggregate)];#[read(via = Base::COLUMN, field = Other::COLUMN)]reads a column of the record the base’s id column names. A field reading a sensitive one needs#[sensitive].- Value
#[sensitive]masks it inDebug. As a handler’s input it is read from the body field named after the type:cancel(order: Order, cancel_reason: CancelReason)takes{ "cancel_reason": … }, andOption<CancelReason>takes it or nothing.