1pub mod admin;
2pub mod cron;
3pub mod error;
4pub mod insert;
5pub mod job;
6pub mod kind;
7pub mod migrations;
8pub mod unique;
9
10pub use cron::{CronJobRow, PeriodicJob, PeriodicJobBuilder};
12pub use error::AwaError;
13pub use insert::{insert, insert_many, insert_many_copy, insert_many_copy_from_pool, insert_with};
14pub use job::{InsertOpts, InsertParams, JobRow, JobState, UniqueOpts};
15
16pub use awa_macros::JobArgs;
18
19pub trait JobArgs: serde::Serialize {
25 fn kind() -> &'static str
27 where
28 Self: Sized;
29
30 fn kind_str(&self) -> &'static str
32 where
33 Self: Sized,
34 {
35 Self::kind()
36 }
37
38 fn to_args(&self) -> Result<serde_json::Value, serde_json::Error> {
40 serde_json::to_value(self)
41 }
42}