Skip to main content

Crate ruest

Crate ruest 

Source
Expand description

§RUEST

Backend framework for Rust — Rust + NestJS (NestJS DX, performance Rust, Axum).

Un seul package framework : cargo add ruest (+ ruest-macros en dépendance transitive). Base de données optionnelle : cargo add ruest-db.

Re-exports§

pub use core::bootstrap;
pub use core::CoreError;
pub use core::HttpModule;
pub use core::Module;
pub use core::RuestApplication;
pub use core::RuestFactory;
pub use di::Container;
pub use di::Inject;
pub use di::Scope;
pub use http::serve;
pub use validation::ValidatedJson;
pub use http::AppError;
pub use http::AppResult;
pub use security::apply_jwt_layer;
pub use security::register_jwt_provider;
pub use security::AuthContext;
pub use security::AuthUser;
pub use security::Guard;
pub use security::JwtDevProvider;
pub use security::JwtGuard;
pub use security::JwtService;
pub use security::RolesGuard;
pub use security::RuestClaims;
pub use security::SecurityConfig;
pub use security::SecurityConfigBuilder;
pub use security::SecurityError;
pub use async_trait;

Modules§

config
Configuration system for RUEST.
core
Core runtime for RUEST: application lifecycle, modules, and bootstrap.
di
Dependency injection container for RUEST.
http
HTTP server layer for RUEST (Axum + Tower, features complètes).
logger
Structured logging for RUEST (tracing).
prelude
Prelude for application code.
router
HTTP routing primitives for RUEST.
security
RUEST Security
testing
Testing utilities for RUEST.
validation
Request validation for RUEST.
ws
Handle WebSocket connections.

Macros§

ruest_err
Erreur HTTP lisible : return Err(ruest_err!(BadRequest, "message"));
static_path
Variante sans allocation quand prefix et suffix sont des littéraux connus à la macro.

Structs§

AppBuilder
Application prête à écouter (DI + routeur Axum monomorphisé).
Body
The body type used in axum requests and responses.
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
ConnectInfo
Extractor for getting connection information produced by a Connected.
Form
URL encoded extractor and response.
Json
JSON Extractor / Response.
MatchedPath
Access the path in the router that matches the request.
Multipart
Extractor that parses multipart/form-data requests (commonly used with file uploads).
OriginalUri
Extractor that gets the original request URI regardless of nesting.
Path
Extractor that will get captures from the URL and parse them using serde.
Query
Extractor that deserializes query strings into some type.
State
Extractor for state.
WebSocket
A stream of WebSocket messages.
WebSocketUpgrade
Extractor for establishing WebSocket connections.

Enums§

WebSocketMessage
A WebSocket message.

Traits§

ModuleWireRoutes
Trait généré implicitement par #[module] (via wire_routes inherent).
Validate
This is the original trait that was implemented by deriving Validate. It will still be implemented for struct validations that don’t take custom arguments. The call is being forwarded to the ValidateArgs<'v_a> trait.

Functions§

bootstrap_app
Bootstrap DI + montage des routes compile-time.

Attribute Macros§

controller
Marks a struct as an HTTP controller with a path prefix.
delete
dto
Marks a struct as a DTO (MVP: passthrough).
get
guard
Déclare une garde d’autorisation (impl Guard).
middleware
Marks an async function as middleware (MVP: passthrough).
module
Declares a NestJS-style module.
patch
post
put
routes
Registers route handlers on a controller impl block.
service
Marks a struct as an injectable service.

Derive Macros§

Validate