Skip to main content

Crate serenade_framework

Crate serenade_framework 

Source
Expand description

§Serenade

Serenade is a Symfony-oriented application framework for Rust: a kernel with bundles, a dependency-injection container, an event dispatcher, layered configuration, and optional components (HTTP, security, messaging, views, forms, …) that applications compose.

serenade-framework is the public entry point for normal Serenade consumers. It re-exports a curated, stable surface of the serenade-* implementation crates. Those crates stay independently published and usable; the facade never owns their implementation.

Website: https://serenade.rs. Guides: https://docs.serenade.rs.

[dependencies]
serenade = { package = "serenade-framework", version = "1.0.0" }

The package rename imports the crate as serenade instead of serenade_framework (cargo add serenade-framework --rename serenade).

The executable named serenade is shipped by the separate serenade-cli package. The crates.io package serenade is unrelated to this project.

§Features

The default build contains only the framework foundations (kernel, config, di, event). It needs no web server, database, Leptos, or Rangular.

FeatureModuleEnables
(default)kernel, config, di, eventFoundations
consoleconsoleserenade-console
bundlebundleserenade-bundle
httphttp, http::clientserenade-http, serenade-http-client
http-actixhttp::actixhttp + serenade-http-actix
http-axumhttp::axumhttp + serenade-http-axum
http-client-reqwesthttp::client::ReqwestHttpClientReqwest outbound client
sessionsessionserenade-session
securitysecurityserenade-security
security-oauth / security-ldapsecurityOAuth / LDAP helpers
validationvalidatorserenade-validator
locklockserenade-lock
rate-limiterrate_limiterserenade-rate-limiter
schedulerschedulerserenade-scheduler
scheduler-messengerschedulerScheduler dispatch through the message bus
messengermessengerserenade-messenger
mailermailerserenade-mailer (no transport backend)
mailer-smtp / mailer-espmailerSMTP / ESP transports
notifiernotifierserenade-notifier
viewviewserenade-view (engine neutral)
view-leptos-ssr / view-leptos-clientviewLeptos SSR / hydrate support
formformview + serenade-form

Integration features (*-reqwest, *-smtp, *-esp, *-oauth, *-ldap, view-leptos-*, scheduler-messenger) are never implied by their base feature.

Crates outside this surface (for example serenade-cache, serenade-workflow, serenade-translation, serenade-testing) are used directly by depending on them.

§Example

use serenade::prelude::*;

struct Shop;

impl BundleInterface for Shop {
    fn name(&self) -> &'static str {
        "shop"
    }
}

let mut app = App::new(Environment::Test);
app.register_bundle(Shop).expect("register");
app.boot().expect("boot");
assert_eq!(app.kernel().bundle_names(), vec!["shop"]);
app.shutdown().expect("shutdown");

Modules§

bundle
Bundle composition and framework bundle.
config
Layered configuration: dotenv, TOML/YAML packages, env overlays.
console
Console application (bin/console analogue).
di
Dependency injection container.
event
Synchronous event dispatcher.
form
HTML forms: binding, CSRF, rendering, multipart.
http
Framework-agnostic HTTP foundation: request, response, routing, middleware, kernel.
kernel
Application kernel, bundles, environment, and lifecycle.
lock
Named locks.
mailer
Email messages and transports.
messenger
Command and event message bus.
notifier
SMS and push notifications.
prelude
Common imports for application code built on the default feature set.
rate_limiter
Rate limiting.
scheduler
Scheduling.
security
Authentication, authorization, CSRF, and password hashing.
session
Session bag, stores, flash messages, and middleware.
validator
Constraint validation for DTOs and commands.
view
HTML view helpers and document composition (template-engine neutral).

Functions§

version
Facade crate version (matches every serenade-* crate in the same release).