Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Framework Adapters

Adapters are behind Cargo features, so the default build has no web framework.

1. Feature flags

[dependencies]
# Axum 0.8
anza = { version = "0.6", features = ["axum"] }

# Actix-web 4
anza = { version = "0.6", features = ["actix"] }

# Everything
anza = { version = "0.6", features = ["full"] }
FeatureProvides
axumIntoResponse for Document (HTML) and Envelope (JSON); anza::adapters::axum::event for SSE
actixResponder for Document (HTML) and Envelope (JSON); anza::adapters::actix::bytes for SSE
watchStarts a notify watcher on the template root and reloads changed templates into the cache
fullAll of the above

2. Sharing the engine

Engine is not Clone. Wrap it in Arc<Engine> for Axum state, or in actix_web::web::Data<Engine> (which is an Arc) for Actix-web.