laravel-rust 0.1.0

Laravel for Rust: a full-stack Rust web framework, inspired by PHP Laravel
Documentation
//! Events: typed values that listeners react to, with injected services.
//!
//! When a customer places an order, the order code can dispatch one event, and listeners send the
//! receipt and write the audit log without the order code knowing about either. This module
//! provides the [`Event`](derive@Event) derive, the [`#[listener]`](macro@listener) attribute, the
//! [`Dispatcher`] that holds listeners, and the [`dispatch`] and [`dispatch_background`]
//! functions. To learn more, check out the
//! [events guide](https://github.com/laravel/rust-framework/blob/0.x/docs/events.md).
//!
//! Applications discover the `#[listener]` functions in the `app` crate automatically. Register
//! other listeners with
//! [`ApplicationBuilder::with_events`](crate::foundation::ApplicationBuilder::with_events).
//! Dispatching an event awaits its listeners in registration order and returns the first
//! failure. Inside a database transaction, the listeners wait for the transaction to commit,
//! unless the event is marked [`#[event(at_dispatch)]`](derive@Event) or the listener is
//! registered with [`Dispatcher::listen_at_dispatch`].
//!
//! ```
//! use laravel::Application;
//! use laravel::event::Event;
//!
//! #[derive(Event)]
//! struct OrderPlaced {
//!     id: u64,
//! }
//!
//! async fn send_receipt(event: Event<OrderPlaced>) {
//!     assert_eq!(event.id, 42);
//! }
//!
//! let app = Application::configure()
//!     .replace_env(laravel::config::Env::default())
//!     .with_events(|events, _| {
//!         events.listen(send_receipt);
//!     })
//!     .create();
//!
//! # laravel::testing::__run(async {
//! app.scope(async || OrderPlaced { id: 42 }.dispatch().await)
//!     .await
//!     .unwrap();
//! # });
//! ```

pub(crate) use laravel_events::event::*;
#[doc(hidden)]
pub use laravel_events::event::{__AtDispatch, __Queued, __Registration};
#[doc(inline)]
pub use laravel_events::event::{
    Dispatcher, Event, EventFake, Listener, Queued, QueuedListener, dispatch, dispatch_background, fake, listener,
};