Skip to main content

laravel_rust_devtools/
lib.rs

1//! Developer tools for [Laravel for Rust](https://laravel.com/rust) applications.
2//!
3//! A floating toolbar for applications in development: a pill at the bottom of each page with its
4//! last request, and a panel with the history of the application's requests, console commands,
5//! queued jobs and scheduled tasks, each with its timeline, queries, log lines, outgoing HTTP,
6//! cache, mail and errors, built on the spans the framework already emits. The crate's README
7//! describes what the panel shows and who sees it.
8//!
9//! An application registers the [`DevtoolsServiceProvider`]. In local development only, as
10//! [`DevtoolsConfig`] allows, it records each request, console command, queued job, scheduled task,
11//! workflow step and tick as a trace into `storage/devtools`, which the application's processes
12//! share, marks each page with its trace for whoever may see the developer tools, adds the pill's
13//! script to their pages, and serves the panel at `/_devtools` and the traces under
14//! `/_devtools/api`. A [`DevtoolsGate`] decides who that is, beyond the provider's own rules or
15//! besides them. These three are the crate's whole API.
16#![warn(
17    missing_docs,
18    unreachable_pub,
19    clippy::missing_errors_doc,
20    clippy::must_use_candidate,
21    rustdoc::missing_crate_level_docs
22)]
23
24#[cfg(debug_assertions)]
25mod collector;
26#[cfg(debug_assertions)]
27mod file_store;
28mod gate;
29#[cfg(debug_assertions)]
30mod http;
31mod provider;
32#[cfg(debug_assertions)]
33mod store;
34// The harness the public API's tests in `tests/devtools` run on, shared with the crate's own tests,
35// which name the crate as those do.
36#[cfg(all(test, debug_assertions))]
37#[path = "../tests/devtools/app.rs"]
38mod app;
39#[cfg(all(test, debug_assertions))]
40extern crate self as laravel_rust_devtools;
41#[cfg(all(test, debug_assertions))]
42#[path = "../tests/devtools/harness.rs"]
43mod harness;
44#[cfg(test)]
45mod tests;
46#[cfg(debug_assertions)]
47mod trace;
48
49pub use gate::DevtoolsGate;
50pub use provider::{DevtoolsConfig, DevtoolsKey, DevtoolsServiceProvider, Enabled, ParseEnabledError};