1#![allow(
3 clippy::collapsible_if,
4 clippy::unnecessary_map_or,
5 clippy::redundant_async_block
6)]
7#![deny(clippy::unwrap_used, clippy::expect_used)]
8#![warn(missing_docs)]
9extern crate self as rullst;
10
11pub mod config;
13pub mod db;
14pub mod edge;
15
16#[cfg(all(not(target_arch = "wasm32"), feature = "orm"))]
17pub mod artisan;
19#[cfg(not(target_arch = "wasm32"))]
20pub mod cache;
21pub mod client;
23pub mod client_contract;
25#[cfg(not(target_arch = "wasm32"))]
26pub mod devops;
28#[cfg(not(target_arch = "wasm32"))]
29pub mod di;
31#[cfg(not(target_arch = "wasm32"))]
32pub mod error_console;
34#[cfg(not(target_arch = "wasm32"))]
35pub mod feature;
37#[cfg(not(target_arch = "wasm32"))]
38pub mod frontend;
40#[cfg(not(target_arch = "wasm32"))]
41pub mod health;
43#[cfg(not(target_arch = "wasm32"))]
44pub mod html;
46#[cfg(not(target_arch = "wasm32"))]
47pub mod htmx;
49#[cfg(not(target_arch = "wasm32"))]
50pub mod lifecycle;
52#[cfg(not(target_arch = "wasm32"))]
53pub mod live;
55#[cfg(not(target_arch = "wasm32"))]
56pub mod multitenant;
58#[cfg(all(not(target_arch = "wasm32"), feature = "offline-sync"))]
59pub mod offline_sync;
61#[cfg(not(target_arch = "wasm32"))]
62pub mod production;
64#[cfg(not(target_arch = "wasm32"))]
65pub mod queue;
66#[cfg(not(target_arch = "wasm32"))]
67pub mod radar;
69#[cfg(not(target_arch = "wasm32"))]
70pub mod realtime;
72#[cfg(not(target_arch = "wasm32"))]
73pub mod resilience;
75#[cfg(not(target_arch = "wasm32"))]
76pub mod routing;
78pub mod rpc;
80#[cfg(not(target_arch = "wasm32"))]
81pub mod scalar;
83#[cfg(not(target_arch = "wasm32"))]
84pub mod scheduler;
85#[cfg(not(target_arch = "wasm32"))]
86pub mod security;
88#[cfg(not(target_arch = "wasm32"))]
89pub mod server;
91#[cfg(not(target_arch = "wasm32"))]
92pub mod storage;
94#[cfg(not(target_arch = "wasm32"))]
95pub mod telemetry;
97#[cfg(not(target_arch = "wasm32"))]
98pub mod telemetry_spans;
100#[cfg(not(target_arch = "wasm32"))]
101pub mod testing;
103#[cfg(not(target_arch = "wasm32"))]
104pub mod uploads;
105#[cfg(not(target_arch = "wasm32"))]
106pub mod validation;
108#[cfg(not(target_arch = "wasm32"))]
109pub mod ws;
111
112#[cfg(all(not(target_arch = "wasm32"), feature = "orm"))]
113#[macro_export]
114macro_rules! artisan {
116 ($migrations:expr) => {
117 let _ = $crate::artisan::check_and_run_artisan($migrations, vec![]).await;
118 };
119 ($migrations:expr, $seeders:expr) => {
120 let _ = $crate::artisan::check_and_run_artisan($migrations, $seeders).await;
121 };
122}
123
124pub use rullst_macros::{
126 html, island, live_component, live_event, memoize, route, server_function,
127};
128
129#[cfg(not(target_arch = "wasm32"))]
131pub use routing::Router;
132
133#[cfg(not(target_arch = "wasm32"))]
134pub use server::{Server, ServerError};
135
136#[cfg(all(not(target_arch = "wasm32"), feature = "orm"))]
138pub use rullst_orm::{Orm, RullstModel};
139
140pub use config::{AppConfig, DatabaseConfig, RullstConfig, SecurityConfig};
142
143#[cfg(not(target_arch = "wasm32"))]
145pub use axum::http;
146
147#[cfg(not(target_arch = "wasm32"))]
149pub mod response {
151 pub use axum::response::{Html, IntoResponse, Redirect, Response};
152}
153
154#[cfg(not(target_arch = "wasm32"))]
156pub use htmx::{HtmxRequest, HtmxResponse, render_page};
157#[cfg(not(target_arch = "wasm32"))]
158pub use lifecycle::{
159 ApplicationLifecycle, ApplicationLifecycleError, ApplicationPhase, ReadinessSnapshot,
160 apply_lifecycle,
161};
162
163#[cfg(not(target_arch = "wasm32"))]
165pub use cache::{Cache, TenantCache};
166#[cfg(not(target_arch = "wasm32"))]
167pub use di::{Container, DiError, Inject, Injectable};
168#[cfg(not(target_arch = "wasm32"))]
169pub use queue::{Queue, QueuedJobDetail, Worker, WorkerHandle};
170#[cfg(not(target_arch = "wasm32"))]
171pub use realtime::{
172 BroadcastManager, Channel, RealtimeError, RealtimeMessage, TenantPresence, TenantRealtime,
173};
174#[cfg(not(target_arch = "wasm32"))]
175pub use scheduler::{Scheduler, SchedulerError, SchedulerFailurePolicy, SchedulerHandle};
176
177#[cfg(not(target_arch = "wasm32"))]
179pub use storage::{LocalDriver, Storage, StorageDriver, StorageError, TenantStorage};
180#[cfg(not(target_arch = "wasm32"))]
181pub use uploads::{
182 OfflineMockScanner, QuarantinedUpload, ReleasedUpload, ScanVerdict, UploadError, UploadKind,
183 UploadPolicy, UploadScanner,
184};
185#[cfg(not(target_arch = "wasm32"))]
186pub use validation::{Validate, ValidatedForm, ValidatedJson, ValidationError};
187#[cfg(not(target_arch = "wasm32"))]
188pub use ws::{WebSocket, WsError};
189
190#[cfg(not(target_arch = "wasm32"))]
192pub use production::{
193 AcademyBoundaryAssessment, AcademyCheckStatus, AcademyPresetError, AcademyProductionPreset,
194 AcademyProductionRequirement, ProductionMiddlewareStage, ProductionPreset,
195};
196#[cfg(not(target_arch = "wasm32"))]
197pub use resilience::{
198 RateLimitConfig, RateLimiter, TrafficShield, TrafficShieldConfig, TrafficShieldError,
199 backpressure_middleware, rate_limit_middleware,
200};
201#[cfg(not(target_arch = "wasm32"))]
202pub use security::{SecurityBaselineError, apply_security_baseline};
203
204#[cfg(not(target_arch = "wasm32"))]
205pub use async_trait::async_trait;
206#[cfg(all(not(target_arch = "wasm32"), feature = "orm"))]
207pub use feature::DbFeatureDriver;
208#[cfg(not(target_arch = "wasm32"))]
209pub use feature::{
210 EnvFeatureDriver, FeatureDriver, FeatureManager, MemoryFeatureDriver, TomlFeatureDriver,
211};
212#[cfg(not(target_arch = "wasm32"))]
213pub use multitenant::{TenantConfig, TenantLayer, TenantService, TenantStrategy, tenant_layer};
214
215#[cfg(not(target_arch = "wasm32"))]
216pub use testing::{TestApp, TestRequestBuilder, TestResponse};
217
218#[cfg(not(target_arch = "wasm32"))]
221pub mod runtime {
223 pub use async_trait::async_trait;
224 pub use tokio::{main, spawn, task, time};
225}
226
227pub mod web {
229 #[cfg(not(target_arch = "wasm32"))]
230 pub use axum;
231 #[cfg(not(target_arch = "wasm32"))]
232 pub use tower;
233 #[cfg(not(target_arch = "wasm32"))]
234 pub use tower_http;
235}
236
237pub mod async_runtime {
239 #[cfg(not(target_arch = "wasm32"))]
240 pub use tokio;
241}