laractions 0.1.0

Actions for Laravel Rust: encapsulate business logic in classes that run now or on the queue.
Documentation
//! Actions for Laravel Rust: encapsulate business logic in structs that run now or on the queue.
//!
//! An action is a struct with a `handle` method. Run it where you are, or hand it to the queue
//! with the same call shape:
//!
//! ```ignore
//! use laractions::{Action, action};
//!
//! #[derive(Default, Serialize, Deserialize)]
//! pub struct SendEmail {}
//!
//! #[action(tries = 3, queue = "emails")]
//! impl SendEmail {
//!     async fn handle(&self, email: String, subject: String, message: String) -> laravel::Result<()> {
//!         Ok(())
//!     }
//! }
//!
//! SendEmail::create().run(("user@example.com", "Welcome!", "Hello User")).await?;
//!
//! SendEmail::create()
//!     .queue("high")
//!     .delay(10)
//!     .retry(5)
//!     .dispatch(args! { email: "user@example.com", subject: "Welcome!", message: "Hello User" })
//!     .await?;
//! ```
//!
//! It is the port of the PHP package [`edulazaro/laractions`](https://github.com/edulazaro/laractions)
//! to Laravel Rust 0.1 (beta), and its API follows the framework's changes until 1.0.

pub mod action;
pub mod arguments;
pub mod concerns;
pub mod console;
pub mod error;
pub mod job;
pub mod provider;
pub mod registry;
pub mod support;
pub mod trace;
pub mod validation;

pub use action::{Action, Pending, Reference, Settings};
pub use arguments::{Arguments, IntoArguments, Parameter, Resolved};
pub use concerns::{Actions, HasActions, IsActor, NamedAction};
pub use error::ActionError;
pub use job::{ActionJob, MAX_TRIES};
pub use laractions_macros::action;
pub use provider::LaractionsServiceProvider;
pub use registry::Registration;
pub use trace::ActionTrace;

#[doc(hidden)]
pub mod __private {
    pub use laravel::__inventory as inventory;
    pub use serde_json::{Map, Value, to_value};

    pub use crate::registry::Registration;
    pub use crate::support::find;
}