Skip to main content

Crate reinhardt

Crate reinhardt 

Source
Expand description

§Reinhardt

A full-stack API framework for Rust, inspired by Django and Django REST Framework.

Reinhardt provides a complete, batteries-included solution for building production-ready REST APIs with Rust. It follows Rust’s composition patterns instead of Python’s inheritance model, making full use of traits, generics, and zero-cost abstractions.

§Core Principles

  • Composition over Inheritance: Uses Rust’s trait system for composable behavior
  • Type Safety: Leverages Rust’s type system for compile-time guarantees
  • Zero-Cost Abstractions: High-level ergonomics without runtime overhead
  • Async-First: Built on tokio and async/await from the ground up

§Feature Flags

Reinhardt provides flexible feature flags to control compilation and reduce binary size.

§Presets

  • minimal - Core functionality only (routing, DI, params)
  • full (default) - All features enabled
  • standard - Balanced for most projects
  • api-only - REST API without templates/forms
  • graphql-server - GraphQL-focused setup
  • websocket-server - WebSocket-centric setup
  • cli-tools - CLI and background jobs
  • test-utils - Testing utilities

§Fine-grained Control

Fine-grained feature flags for precise control over included functionality:

§Authentication ✅
  • auth-jwt - JWT authentication
  • auth-session - Session-based authentication
  • auth-oauth - OAuth2 support
  • auth-token - Token authentication
§Database Backends ✅
  • db-postgres - PostgreSQL support
  • db-mysql - MySQL support
  • db-sqlite - SQLite support
  • db-cockroachdb - CockroachDB support (distributed transactions)
§Middleware ✅
  • middleware-cors - CORS (Cross-Origin Resource Sharing) middleware
  • middleware-compression - Response compression (Gzip, Brotli)
  • middleware-security - Security headers (HSTS, XSS Protection, etc.)
  • middleware-rate-limit - Rate limiting and throttling

See Cargo.toml feature definitions for detailed documentation.

§Quick Example

use reinhardt::prelude::*;
use serde::{Serialize, Deserialize};
use std::sync::Arc;

// Define your model (using composition, not inheritance)
#[derive(Debug, Clone, Serialize, Deserialize)]
struct User {
    id: Option<i64>,
    username: String,
    email: String,
}

// Implement Model trait
impl Model for User {
    type PrimaryKey = i64;
    fn table_name() -> &'static str { "users" }
    fn primary_key(&self) -> Option<&Self::PrimaryKey> { self.id.as_ref() }
    fn set_primary_key(&mut self, value: Self::PrimaryKey) { self.id = Some(value); }
}

// Create a ViewSet (no inheritance needed!)
let users_viewset = ModelViewSet::<User, JsonSerializer<User>>::new("users");

// Set up routing
let mut router = DefaultRouter::new();
router.register_viewset("users", users_viewset);

// Add middleware using composition
let app = MiddlewareChain::new(Arc::new(router))
    .with_middleware(Arc::new(LoggingMiddleware::new()))
    .with_middleware(Arc::new(CorsMiddleware::permissive()));

Modules§

acceptrest and native
Accept header parsing
adminadmin and native
Admin panel functionality
appscore and native
Application configuration and registry module.
auto_schemaopenapi and native
Automatic schema generation from Rust types
browsable_apirest and native
Browsable API for Reinhardt
cacherest and native
Caching for negotiation results
commandscommands and native
Management commands for Reinhardt framework
confconf and native
Configuration and settings module.
configopenapi and native
OpenAPI configuration for endpoint mounting
corecore and native
Core framework types and utilities module.
dbdatabase and native
Database re-exports for Model derive macro generated code.
deeplinkdeeplink and native
Mobile deep linking module.
dentdeliondentdelion and native
Plugin system module.
detectorrest and native
Content-Type detection from request body
didi and native
Dependency injection module.
dispatchdispatch and native
Request dispatching module.
encodingrest and native
Encoding negotiation based on Accept-Encoding header
endpoint_inspectoropenapi and native
Endpoint Inspector for Function-Based Routes
endpointsopenapi and native
OpenAPI endpoint handlers for automatic documentation mounting
enum_schemaopenapi and native
Advanced enum schema generation
filtersrest and native
Type-safe filtering backends for Reinhardt framework
formsforms and native
Forms and validation module.
generatoropenapi and native
OpenAPI schema generator with registry integration
graphqlgraphql and native
GraphQL API module.
grpcgrpc and native
gRPC service module.
httpnative
HTTP request and response types module.
i18ni18n and native
Internationalization module.
inventory
githubcrates-iodocs-rs
languagerest and native
Language negotiation based on Accept-Language header
mailmail and native
Email sending module.
media_typerest and native
Media type representation
metadatarest and native
Reinhardt Metadata
middleware(standard or middleware) and native
Middleware module.
migrationsdatabase and native
Reinhardt Migrations
negotiationrest and native
Content negotiation for request/response formats. Content negotiation for Reinhardt
negotiatorrest and native
Content negotiator
openapiopenapi and native
OpenAPI 3.0 types with Reinhardt extensions
pagespages
WASM-based reactive frontend framework with SSR
paginationrest and native
Pagination strategies (page-based, cursor, limit-offset).
param_metadataopenapi and native
Parameter metadata extraction for OpenAPI schema generation
parsersrest and native
Request body parsers (JSON, form, multipart, etc.).
preludenative
Convenience re-exports of commonly used types (server-side only).
querydatabase and native
SQL query builder module.
redirectshortcuts and native
HTTP redirect helpers (temporary and permanent). Redirect shortcut functions
registryopenapi and native
Schema registry for managing reusable component schemas
restrest and native
REST API module.
reversenative
URL reverse resolution (name-to-URL mapping).
schema_registrationopenapi and native
Compile-time schema registration infrastructure
serde_attrsopenapi and native
Serde attributes integration for OpenAPI schema generation
serializersrest and native
Reinhardt Serializers
serverserver and native
Server module - HTTP/HTTP2/WebSocket server implementations
shortcutsshortcuts and native
Shortcut functions for common operations.
streamingstreaming
Streaming module.
swaggeropenapi and native
Swagger UI integration
taskstasks and native
Background tasks module.
templatetemplates and native
Template and rendering module.
testtest and native
Testing utilities module.
throttlingrest and native
Rate limiting for Reinhardt framework
urlsnative
URL routing module.
utilsnative
Utility functions module.
utoipaopenapi and native
Want to have your API documented with OpenAPI? But you don’t want to see the trouble with manual yaml or json tweaking? Would like it to be so easy that it would almost be like utopic? Don’t worry utoipa is just there to fill this gap. It aims to do if not all then the most of heavy lifting for you enabling you to focus writing the actual API logic instead of documentation. It aims to be minimal, simple and fast. It uses simple proc macros which you can use to annotate your code to have items documented.
versioningrest and native
Reinhardt Versioning
viewsnative
Views module.

Macros§

collect_migrationsdatabase and native
Collect migrations and register them with the global registry
define_viewsDeprecatednative
flatten_importsnative
Function-like proc macro for multi-file view modules.
installed_appscore and native
Defines installed applications with compile-time validation.
pathnative
Validates URL path syntax at compile time.

Structs§

APIClienttest and native
Test client for making API requests
APIRequestFactorytest and native
Factory for creating test requests
APITestCasetest and native
Base test case for API testing
Absdatabase and native
Abs - absolute value
AcceptHeaderVersioningrest and native
Accept header versioning
Actionnative
Action metadata
ActionMetadatarest and native
Action metadata (for POST, PUT, etc.)
AdvancedSettingsDeprecatedconf and native
Main application settings
Aggregatedatabase and native
Aggregate expression
AllowAnyauth and native
AllowAny - grants permission to all requests
Annotationdatabase and native
Represents an annotation on a QuerySet
AnonRateThrottlerest and native
Rate throttle for anonymous (unauthenticated) requests.
AnonymousUserauth and native
Anonymous user - represents a non-authenticated visitor
AppConfigcore and native
Configuration for a single application
Appscore and native
Main application registry
Argon2Hasherauth and argon2-hasher
Argon2id password hasher (recommended for new applications)
ArrayBuilderopenapi and native
Builder for Array with chainable configuration methods to create a new Array.
AuthInfoauth and native
Lightweight authentication extractor that reads from request extensions.
AuthUserauth and native
Authenticated user extractor that loads the full user model from database.
AuthenticationMiddlewaresessions and middleware and native
Authentication middleware Extracts user information from session and attaches it to request extensions
BTreeIndexdatabase and native
B-Tree index (default)
BaseNegotiatorrest and native
Base content negotiation implementation (abstract)
Body(minimal or standard or di) and native
Extract the raw request body as bytes
BoundFieldforms and native
BoundField represents a field bound to form data
BroadcastResultwebsockets and native
Result of a broadcast operation that tracks individual send outcomes.
CacheKeyBuildercache and native
Cache key builder for generating cache keys
CacheMiddlewaremiddleware and native
Cache Middleware
CacheSessionBackendsessions and native
Cache-based session backend
CacheSettingsconf and native
Cache settings
Castdatabase and native
Cast expression - convert a value to a specific type
Ceildatabase and native
Ceil - round up to nearest integer
CharFieldforms and native
Character field with length validation
CheckConstraintdatabase and native
CHECK constraint (similar to Django’s CheckConstraint)
ChoiceInforest and native
Choice information for choice fields
Claimsauth-jwt and native
JWT Claims
ClientPathclient-router
Single path parameter extractor.
ClientPathPatternclient-router
Represents a compiled path pattern.
ClientRouteclient-router
A single route definition.
ClientRouteMatchclient-router
A matched route with extracted parameters.
ClientRouterclient-router
The main client-side router.
ClientUrlReverserclient-router
Thread-safe reverse URL resolver for client-side routes.
Componentsopenapi and native
Implements OpenAPI Components Object which holds supported reusable objects.
Concatdatabase and native
Concat - concatenate multiple strings
ConnectionPooldatabase and native
A database connection pool
ConsumerContextwebsockets and native
Consumer context containing connection and message information
ContentNegotiatorrest and native
Content negotiator for selecting appropriate renderer
ContentTypedatabase and native
Represents a content type (model) in the system
ContentTypeRegistrydatabase and native
Registry for managing content types
Cookie(minimal or standard or di) and native
Extract a value from cookies
CookieParamopenapi and native
Marker type for Cookie parameter metadata
CookieSessionAuthMiddlewaresessions and middleware and native
Middleware that authenticates requests via a session cookie.
CookieSessionConfigsessions and middleware and native
Configuration for cookie-based session authentication.
CoreSettingsconf and native
Core application settings.
CorsMiddlewaremiddleware-cors and native
CORS middleware
CorsSettingsconf and native
CORS settings
CreateGroupDataauth and native
Group creation data
CreateUserDataauth and native
User data for creation
CreditCardValidatorcore and native
Credit card number validator
CspConfig(standard or middleware) and native
CSP directive configuration
CspMiddleware(standard or middleware) and native
Content Security Policy middleware
CspNonce(standard or middleware) and native
Type wrapper for CSP nonce stored in Request extensions
CurrentDatedatabase and native
CurrentDate - current date
CurrentTimedatabase and native
CurrentTime - current time
CurrentUserDeprecatedauth and native
Wrapper type representing the currently authenticated user for DI.
CursorPaginationrest and native
Cursor-based pagination for large datasets
DatabaseConfigconf and native
Database configuration
DatabaseConnectiondatabase and native
Database connection wrapper
DefaultRouternative
Default router implementation Similar to Django REST Framework’s DefaultRouter and Django’s URLResolver
DefaultSourceconf and native
Default values configuration source
DefaultUserDeprecatedauth and argon2-hasher
DefaultUser struct - Django’s AbstractUser equivalent
DefaultUserManagerauth and argon2-hasher
DefaultUserManager - In-memory user manager for DefaultUser
DenseRankdatabase and native
DENSE_RANK window function
Dependsdi and native
Dependency injection wrapper similar to FastAPI’s Depends.
DependsBuilderdi and native
Builder for Depends to support FastAPI-style API.
DetailViewnative
DetailView for displaying a single object
EmailFieldforms and native
Email field with format validation
EmailSettingsconf and native
Email settings
EmailValidatorcore and native
Email address validator
EndpointInspectoropenapi and native
Endpoint inspector for function-based routes
EndpointMetadatacore and native
Endpoint metadata for OpenAPI generation
EnumSchemaBuilderopenapi and native
Builder for enum schemas
EnvSourceconf and native
Environment variable configuration source
Existsdatabase and native
Exists - check if a subquery returns any rows
Extensionscore and native
Type-safe extension storage
Extractdatabase and native
Extract component from date/time
Fdatabase and native
F expression - represents a database field reference Similar to Django’s F() objects for database-side operations
FieldInforest and native
Field metadata information
FieldInfoBuilderrest and native
Builder for field information
FieldMetadataopenapi and native
Field metadata extracted from serde attributes
FieldRefdatabase and native
Type-safe field reference for database operations
FieldStatedatabase and native
Field state for migration detection
FileFieldforms and native
FileField for file upload
FileUploadParserrest and native
Raw file upload parser
Filterdatabase and native
Represents a filter.
FirstValuedatabase and native
FIRST_VALUE window function
Floordatabase and native
Floor - round down to nearest integer
ForeignKeyConstraintdatabase and native
Foreign Key constraint
Formforms and native
Form data structure (Phase 2-A: Enhanced with client-side validation rules)
FormParserrest and native
Form parser for application/x-www-form-urlencoded content type
Framedatabase and native
Window frame specification
GenericForeignKeydatabase and native
Generic foreign key field
GenericRelationQuerydatabase and native
Helper for building generic relation queries
GenericViewSetnative
Generic ViewSet without built-in CRUD logic.
GinIndexdatabase and native
GIN index (for arrays, JSONB, full-text search)
GistIndexdatabase and native
GiST index (for geometric data, full-text search)
Greatestdatabase and native
Greatest - return the maximum value among expressions
Groupauth and native
User group
GroupManagerauth and native
Group manager
HashIndexdatabase and native
Hash index
Header(minimal or standard or di) and native
Extract a value from request headers
HeaderParamopenapi and native
Marker type for Header parameter metadata
HistoryStateclient-router
State object stored in the history entry.
HostNameVersioningrest and native
Hostname versioning
HttpSessionConfigsessions and middleware and native
HTTP session configuration
IBANValidatorcore and native
IBAN validator implementing ISO 13616 standard
IPAddressValidatorcore and native
IP Address validator - validates IPv4 and IPv6 addresses using std::net::IpAddr
InMemoryCachecache and native
In-memory cache backend
InMemorySessionBackendsessions and native
In-memory session backend
InMemoryStoragestorage and native
In-memory storage backend
Indexdatabase and native
Index definition
Infoopenapi and native
OpenAPI Info object represents metadata of the API.
InjectedDeprecateddi and native
Injected dependency wrapper
InjectionContextdi and native
The main injection context for dependency resolution.
InjectionContextBuilderdi and native
Builder for constructing InjectionContext instances.
InjectionMetadatadi and native
Injection metadata
IntegerFieldforms and native
Integer field with range validation
IsAdminUserauth and native
IsAdminUser - requires the user to be an admin
IsAuthenticatedauth and native
IsAuthenticated - requires the user to be authenticated
JSONParserrest and native
JSON parser for application/json content type
Json(minimal or standard or di) and native
Extract and deserialize JSON from request body
JsonSerializerrest and native
JSON serializer implementation
JwtAuthauth-jwt and native
JWT Authentication handler
JwtAuthMiddlewaremiddleware-auth-jwt and native
JWT authentication middleware for stateless token-based auth.
Lagdatabase and native
LAG window function
LastValuedatabase and native
LAST_VALUE window function
Leaddatabase and native
LEAD window function
Leastdatabase and native
Least - return the minimum value among expressions
Lengthdatabase and native
Length - return the length of a string
LimitOffsetPaginationrest and native
Limit/offset based pagination
ListViewnative
ListView for displaying multiple objects
LocalStoragestorage and native
Local filesystem storage
LoggingMiddleware(standard or middleware) and native
Django-style request logging middleware with colored output
LoggingSettingsconf and native
Logging settings
LoginRequiredConfig(standard or middleware) and native
Configuration for LoginRequiredMiddleware.
LoginRequiredMiddleware(standard or middleware) and native
Login required middleware.
LowPriorityEnvSourceconf and native
Low-priority environment variable configuration source
Lowerdatabase and native
Lower - convert string to lowercase
M2MChangeEventcore and native
M2M changed signal - sent when many-to-many relationships change
MediaSettingsconf and native
Media files settings
MediaTyperest and native
Media type representation
MetadataOptionsrest and native
Options for configuring metadata
MetadataResponserest and native
Complete metadata response
Methodnative
The Request Method (VERB)
MiddlewareChaincore and native
Middleware chain - composes multiple middleware into a single handler.
MiddlewareConfigconf and native
Middleware configuration
Migrationdatabase and native
A database migration
MigrationAutodetectordatabase and native
Migration autodetector
MigrationPlandatabase and native
Migration execution plan
MigrationRecorderdatabase and native
Migration recorder (in-memory only, for backward compatibility)
Moddatabase and native
Mod - modulo operation
ModelFormforms and native
A form that is automatically generated from a Model
ModelStatedatabase and native
Model state for migration detection
ModelViewSetnative
ModelViewSet - combines all CRUD mixins, backed by a real ModelViewSetHandler for database-backed CRUD.
MultiPartParserrest and native
MultiPart parser for multipart/form-data content type (file uploads)
MultiTermSearchrest and native
Combines multiple search terms across multiple fields
NTiledatabase and native
NTILE window function
NamespaceVersioningrest and native
Namespace versioning (URL namespace-based)
Nowdatabase and native
Now - current timestamp
NthValuedatabase and native
NTH_VALUE window function
NullIfdatabase and native
NullIf - return NULL if two expressions are equal
ObjectBuilderopenapi and native
Builder for Object with chainable configuration methods to create a new Object.
ObjectPermissionauth and native
Object permission with Permission trait support
ObjectPermissionManagerauth and native
Object permission manager
OpenApiConfigDeprecatedopenapi and native
Configuration for OpenAPI endpoint mounting
OpenApiRouteropenapi-router and native
Router wrapper that adds OpenAPI documentation endpoints
OpenApiSchemaopenapi and native
Root object of the OpenAPI document.
Operationopenapi and native
Implements OpenAPI Operation Object object.
OriginGuardMiddleware(standard or middleware) and native
Middleware that validates the Origin or Referer header on state-changing requests as a CSRF protection layer.
OuterRefdatabase and native
OuterRef - reference to a field in the outer query (for subqueries)
PageNumberPaginationrest and native
Page number based pagination
PagesAuthenticatorwebsockets-pages and native
Authenticator that integrates with reinhardt-pages’ Cookie/session authentication
PaginatedResponserest and native
Paginated response wrapper
ParamContextclient-router
Context for parameter extraction.
Parameteropenapi and native
Implements OpenAPI Parameter Object for Operation.
Path(minimal or standard or di) and native
Extract typed values from URL path parameters.
PathItemopenapi and native
Implements OpenAPI Path Item Object what describes Operations available on a single path.
PathMatchernative
Path matcher - uses composition to match paths
PathParamopenapi and native
Marker type for Path parameter metadata
PathPatternnative
Path pattern for URL matching Similar to Django’s URL patterns but using composition
PersistentRemoteUserMiddlewaresessions and middleware and native
Persistent remote user authentication middleware.
PhoneNumberValidatorcore and native
Phone number validator for international phone numbers
PoolConfigdatabase and native
Represents a pool config.
Powerdatabase and native
Power - raise to a power
ProjectStatedatabase and native
Project state for migration detection
Query(minimal or standard or di) and native
Extract query parameters from the URL
QueryParamopenapi and native
Marker type for Query parameter metadata
QueryParameterVersioningrest and native
Query parameter versioning
QuerySetdatabase and native
Represents a query set.
Rankdatabase and native
RANK window function
ReadOnlyModelViewSetnative
ReadOnlyModelViewSet - exposes only list and retrieve against a real ModelViewSetHandler.
RedisCachecache and redis-backend and native
Redis cache backend with connection pooling
RedisSessionBackendsession-redis and middleware and native
Session backend backed by Redis.
RedocUIopenapi and native
Redoc UI handler (alternative to Swagger UI)
RemoteUserMiddlewaresessions and middleware and native
Remote user authentication middleware.
RendererInforest and native
Renderer information for testing
Requestcore and native
HTTP Request representation
RequestBodyopenapi and native
Implements OpenAPI Request Body.
RequestContextdi and native
Context for per-request dependency injection resolution.
RequestScopedi and native
Per-request dependency cache that stores resolved instances for the duration of a request.
Responsecore and native
HTTP Response representation
Roomwebsockets and native
A WebSocket room that manages multiple client connections
RoomManagerwebsockets and native
Manages multiple WebSocket rooms
Rounddatabase and native
Round - round to specified decimal places
Routenative
Route definition Uses composition to combine path patterns with handlers Similar to Django’s URLPattern
RowNumberdatabase and native
ROW_NUMBER window function
Savepointdatabase and native
Savepoint for nested transactions
Schedulertasks and native
Task scheduler for managing periodic tasks
SchemaBuilderExtopenapi and native
Schema builder with serde attribute support
SchemaGeneratoropenapi and native
Schema generator for OpenAPI schemas
SchemaRegistrationopenapi and native
Compile-time schema registration metadata
SchemaRegistryopenapi and native
A registry for managing reusable OpenAPI schemas
ScopedRateThrottlerest and native
Scope-based rate throttle with per-scope rate limits.
SecurityConfigDeprecatedmiddleware-security and native
Security middleware configuration
SecurityMiddlewaremiddleware-security and native
Security middleware for HTTP security headers and redirects
SecuritySettingsconf and native
Security-related configuration settings.
Serveropenapi and native
Represents target server object. It can be used to alter server connection for path operations.
ServerRouternative
Unified router with hierarchical routing support
Sessionsessions and native
Django-style session object with dictionary-like interface
SessionMiddlewaresessions and middleware and native
Session middleware
SessionSettingsconf and native
Session settings
SettingsDeprecatedconf and native
Main settings structure for a Reinhardt project
SettingsBuilderconf and native
Settings builder for layered configuration
Signalcore and native
A signal that can dispatch events to connected receivers
SimpleMetadatarest and native
Simple metadata implementation
SimpleUserauth and native
Simple user implementation with basic fields
SingletonScopedi and native
Application-wide dependency cache that persists across all requests.
SoftDeletedatabase and native
Soft delete field that can be composed into structs
Sqrtdatabase and native
Sqrt - square root
StaticSettingsconf and native
Static files settings
StatusCodenative
An HTTP status code (status-code in RFC 9110 et al.).
Subquerydatabase and native
Subquery - represents a subquery expression
Substrdatabase and native
Substr - extract a substring
SwaggerUIopenapi and native
Swagger UI handler
Tagopenapi and native
Implements OpenAPI Tag Object.
TaskQueuetasks and native
A task queue that delegates to a backend for task storage and retrieval.
TemplateConfigconf and native
Template engine configuration
TestResponsetest and native
Test response wrapper
Timestampsdatabase and native
Common timestamp fields that can be composed into structs
TomlFileSourceconf and native
TOML file configuration source
Transactiondatabase and native
Transaction manager
TransactionScopedatabase and native
Transaction scope guard with automatic rollback on drop
Trimdatabase and native
Trim - remove leading and trailing whitespace
URLPathVersioningrest and native
URL path versioning
UnifiedRouterclient-router
Unified router combining server and client routing capabilities.
UniqueConstraintdatabase and native
UNIQUE constraint (similar to Django’s UniqueConstraint)
UpdateUserDataauth and native
User data for update
Upperdatabase and native
Upper - convert string to uppercase
UrlPatternsRegistrationnative
URL patterns registration for compile-time discovery
UrlReversernative
URL reverser for resolving names back to URLs Similar to Django’s URLResolver reverse functionality
UrlValidatorcore and native
URL validator
UserManagerauth and native
User manager
UserRateThrottlerest and native
Rate throttle for authenticated user requests.
ValidationErrorscore and native
Aggregates validation errors by field name.
VersioningMiddlewarerest and native
Middleware for automatic API version detection
WebSocketConnectionwebsockets and native
WebSocket connection with activity tracking and timeout support
WebSocketRoutewebsockets and native
A registered WebSocket route (path + optional name + metadata).
WebSocketRouterwebsockets and native
WebSocket router: build-time registration + runtime lookup.
Windowdatabase and native
Window specification
XFrameOptionsMiddleware(standard or middleware) and native
X-Frame-Options middleware for clickjacking protection

Enums§

ActionTypenative
Action type for ViewSet operations
AggregateFuncdatabase and native
Aggregate function types
AggregateValuedatabase and native
Result of an aggregation
AnnotationValuedatabase and native
Represents an annotation value that can be added to a QuerySet
AppErrorcore and native
Errors that can occur when working with the application registry
DatabaseBackenddatabase and native
Defines possible database backend values.
DiErrordi and native
Errors that can occur during dependency injection resolution.
EnumTaggingopenapi and native
Enum tagging strategy
Errorcore and native
The main error type for the Reinhardt framework.
ExtractComponentdatabase and native
Defines possible extract component values.
FieldErrorforms and native
Error type returned when field validation fails.
FieldTyperest and native
Field type enumeration for metadata
FilterErrorrest and native
Errors that can occur during query filtering.
FilterOperatordatabase and native
Defines possible filter operator values.
FilterValuedatabase and native
Defines possible filter value values.
FormErrorforms and native
Error type returned when form-level validation fails.
FrameBoundarydatabase and native
Frame boundary
FrameTypedatabase and native
Window frame type
GroupManagementErrorauth and native
Group management error
IsolationLeveldatabase and native
Transaction isolation levels
JwtErrorauth-jwt and native
JWT-specific errors with distinct variants for each failure mode.
M2MActioncore and native
Actions that can occur on a many-to-many relationship.
Messagewebsockets and native
WebSocket message types
MigrationErrordatabase and native
Errors that can occur during migration operations.
NavigationTypeclient-router
The type of navigation that occurred.
NegotiationErrorrest and native
Error type for negotiation failures
Numberopenapi and native
Flexible number wrapper used by validation schema attributes to seamlessly support different number syntaxes.
OnDeletedatabase and native
Defines possible on delete values.
OnUpdatedatabase and native
Defines possible on update values.
Orderdatabase and native
Ordering direction for ORDER BY clauses.
ParameterLocationopenapi and native
In definition of Parameter.
PoolErrordatabase and native
Defines possible pool error values.
Profileconf and native
Application profile/environment
Qdatabase and native
Q object - represents a complex query condition Similar to Django’s Q() objects for building complex queries
QOperatordatabase and native
Q operator for combining query conditions
QueryBuilderValuedatabase and native
Core value representation for SQL parameters.
QueryValuedatabase and native
Query value types
RefOropenapi and native
A Ref or some other type T.
RenameAllopenapi and native
Rename transformation strategy
Requiredopenapi and native
Value used to indicate whether parameter or property is required.
RoomErrorwebsockets and native
Error types for room operations
RouteErrorwebsockets and native
Routing errors for WebSocket routes
RouterFactorynative
Factory for creating server routers, supporting both sync and async creation.
SameSitesessions and middleware and native
SameSite cookie attribute
Schemaopenapi and native
Is super type for OpenAPI Schema Object. Schema is reusable resource what can be referenced from path operations and other components using Ref.
SchemaErroropenapi and native
Errors that can occur during OpenAPI schema operations.
Scopedi and native
Defines the lifetime scope of a dependency.
SessionErrorsessions and native
Session backend errors
SettingsErrorconf and native
Settings error
SqlTypedatabase and native
Defines possible sql type values.
TrimTypedatabase and native
Defines possible trim type values.
UserManagementErrorauth and native
User management error
ValidatorErrorcore and native
Validation errors produced by validators.
VersioningErrorrest and native
Errors that can occur during API version determination.
WebSocketErrorwebsockets and native
Errors that can occur during WebSocket operations.
XFrameOptions(standard or middleware) and native
X-Frame-Options values

Statics§

CONTENT_TYPE_REGISTRYdatabase and native
Global content type registry.

Traits§

ApplyUpdate
Trait for applying partial updates from one struct to another.
AuthBackendauth and native
Authentication backend trait
BaseContentNegotiationrest and native
Base content negotiator trait
BaseMetadatarest and native
Base trait for metadata providers
BaseUserauth and native
BaseUser trait - Django-style authentication
BaseVersioningrest and native
Base trait for API versioning strategies
Cachecache and native
Base cache trait
ClientUrlResolver
Trait for resolving client-side (frontend) URLs by route name.
ComponentsExtopenapi and native
Extension trait for Components to provide convenient methods
Constraintdatabase and native
Base trait for all constraints
CreateMixinnative
Create mixin - provides create() action
Deserializerrest and native
Deserializer trait for one-way deserialization
DestroyMixinnative
Destroy mixin - provides destroy() action
FieldOrderingExtrest and native
Extension trait to add ordering methods to Field
FilterBackendrest and native
A backend that applies query parameter filters to a SQL query string.
FromPathclient-router
Trait for extracting typed values from path parameters.
FullUserauth and native
FullUser trait - Django’s AbstractUser equivalent
GenericRelatabledatabase and native
Trait for models that can be targets of generic relations
Handlercore and native
Handler trait for processing requests.
HasCoreSettingsconf and native
Trait for accessing the settings fragment from a composed settings type.
HasSettingsconf and native
Generic accessor trait for settings fragments.
Injectabledi and native
Injectable trait for dependencies.
IntoValuedatabase and native
Trait for converting Rust types to SQL values.
ListMixinnative
Mixin traits for ViewSet functionality These use composition instead of multiple inheritance List mixin - provides list() action
Middlewarecore and native
Middleware trait for request/response processing.
Modeldatabase and native
Core trait for database models Uses composition instead of inheritance - models can implement multiple traits
ModelTypedatabase and native
Trait for models that can be registered as content types
MultipleObjectMixinnative
Trait for views that work with multiple objects
ObjectPermissionCheckerauth and native
Object permission checker trait
OpenApiSchemaExtopenapi and native
Extension trait for OpenApiSchema to provide convenient methods
OperationExtopenapi and native
Extension trait for Operation to provide convenient methods
Paginatorrest and native
Trait for pagination implementations
ParameterExtopenapi and native
Extension trait for Parameter to provide convenient constructors
ParameterMetadataopenapi and native
Trait for types that can provide OpenAPI parameter metadata
Parserrest and native
Trait for request body parsers
PasswordHasherauth and native
Password hasher trait
PathItemExtopenapi and native
Extension trait for PathItem to provide constructor
Permissionauth and native
Permission trait - defines permission checking interface
PermissionsMixinauth and native
PermissionsMixin trait - Django’s PermissionsMixin equivalent
RequestVersionExtrest and native
Extension trait to get API version from request
ResponsesExtopenapi and native
Extension trait for Responses to provide collection methods
RetrieveMixinnative
Retrieve mixin - provides retrieve() action
Routernative
Router trait - composes routes together
SchemaExtopenapi and native
Extension trait for Schema to provide convenient constructor methods
Serializerrest and native
Core serializer trait for converting between input and output representations
SessionBackendsessions and native
Session backend trait
SettingsFragmentconf and native
A composable unit of configuration.
SingleFromPathclient-router
Trait for extracting a single value at a specific index from path parameters.
SingleObjectMixinnative
Trait for views that work with a single object
SoftDeletabledatabase and native
Trait for soft-deletable models Another composition trait instead of inheritance
Storagestorage and native
Trait for file storage backends
Tasktasks and native
Core trait that all tasks must implement, providing identity and metadata.
TaskExecutortasks and native
Trait for tasks that can be executed asynchronously.
Throttlerest and native
Core trait for rate-limiting strategies.
Timestampeddatabase and native
Trait for models with timestamps - compose this with Model This follows Rust’s composition pattern rather than Django’s inheritance
ToSchemaopenapi and native
Trait for types that can generate OpenAPI schemas
TransactionExecutordatabase and native
Transaction executor trait for database-specific transaction handling
UpdateMixinnative
Update mixin - provides update() action
UrlPatternnative
Trait for URL patterns that can be reversed at compile time
UrlPatternWithParamsnative
Trait for URL patterns with parameters
UrlResolvernative
Base trait for type-safe URL resolution.
Validatecore and native
Trait for struct-level validation.
Validatorcore and native
Trait for validators
Viewnative
Base trait for all generic views
ViewSetnative
ViewSet trait - similar to Django REST Framework’s ViewSet Uses composition of mixins instead of inheritance
WebSocketConsumerwebsockets and native
WebSocket consumer trait
WebSocketUrlResolvernative
Trait for resolving WebSocket endpoint URLs by route name.
WindowFunctiondatabase and native
Base trait for window functions

Functions§

atomicdatabase and native
Execute a function within a transaction scope
atomic_with_isolationdatabase and native
Execute a function within a transaction with specific isolation level
clear_client_reverserclient-router
Clear the registered client reverser.
clear_routernative
Clear the registered router (useful for tests)
clear_websocket_routerwebsockets and native
Clears the process-wide WebSocket router (primarily for tests).
generate_openapi_schemaopenapi and native
Generate OpenAPI schema from global registry
get_client_reverserclient-router
Retrieve the globally registered ClientUrlReverser.
get_list_or_404shortcuts and database and native
Get a list of objects from the database or return a 404 response if empty
get_object_or_404shortcuts and database and native
Get a single object from the database or return a 404 response
get_routernative
Get a reference to the globally registered router
get_websocket_routerwebsockets and native
Returns a clone of the current process-wide WebSocket router, if set.
includenative
Create an IncludedRouter from a list of routes Similar to Django’s include() function
is_router_registerednative
Check if a router has been registered
m2m_changedcore and native
Returns the M2M changed signal for the given model types.
pathnative
Create a route using simple path syntax Similar to Django’s path() function
post_deletecore and native
Post-delete signal - sent after a model instance is deleted
post_savecore and native
Post-save signal - sent after a model instance is saved
pre_deletecore and native
Pre-delete signal - sent before a model instance is deleted
pre_savecore and native
Pre-save signal - sent before a model instance is saved
re_pathnative
Create a route using regex syntax Similar to Django’s re_path() function
redirectshortcuts and native
Create a validated temporary redirect (HTTP 302) to the specified URL.
register_client_reverserclient-router
Register a ClientUrlReverser globally.
register_routernative
Register the application’s main router globally
register_router_arcnative
Register a router that is already wrapped in Arc.
register_websocket_routerwebsockets and native
Installs router as the process-wide WebSocket router.
render_htmlshortcuts and native
Render a simple HTML string and return an HTTP 200 response
render_jsonshortcuts and native
Render data as JSON and return an HTTP 200 response, or an error if serialization fails
render_textshortcuts and native
Render a simple text string and return an HTTP 200 response
reversenative
Standalone reverse function for convenience Similar to Django’s reverse() function
reverse_websocket_urlwebsockets and native
Resolves a registered or pending WebSocket URL by route name.
validate_auth_extractorsauth and native
Validates that the DI context is properly configured for auth extractors.

Type Aliases§

AppResultcore and native
A specialized Result type for application operations.
Contextnative
Context data for template rendering
DiResultdi and native
A specialized Result type for dependency injection operations.
FilterResultrest and native
A convenience type alias for filter operation results.
FormResultforms and native
Result type alias for form-level operations.
GroupManagementResultauth and native
Group management result
OptionalInjectedDeprecateddi and native
Optional injected dependency
ParseErrorrest and native
Type alias for parser errors, using the framework’s Error type.
ParseResultrest and native
Type alias for parser results, using the framework’s Result type.
Resultcore and native
A convenient Result type alias using reinhardt_core::exception::Error as the error type.
RoomResultwebsockets and native
A specialized Result type for room operations.
RouteResultwebsockets and native
Routing result type
SchemaObjectopenapi and native
A complete schema object with metadata This is an alias to utoipa’s Schema for convenience
SchemaResultopenapi and native
Result type for OpenAPI schema operations.
UserManagementResultauth and native
User management result
ValidationResultcore and native
Result type for validation operations.
ViewResultcore and native
A convenient type alias for view/endpoint function return types.
WebSocketResultwebsockets and native
A specialized Result type for WebSocket operations.

Attribute Macros§

adminadmin and native
Attribute macro for ModelAdmin configuration
api_viewnative
Decorator for function-based API views
app_configcore and native
Attribute macro for Django-style AppConfig definition with automatic derive
apply_updatenative
Attribute macro for applying partial updates to target structs
deletenative
DELETE method decorator
getnative
GET method decorator
modeldatabase and native
Attribute macro for Django-style model definition with automatic derive
patchnative
PATCH method decorator
postnative
POST method decorator
putnative
PUT method decorator
routesnative
Register URL patterns for automatic discovery by the framework
settingsconf and native
Settings attribute macro for composable configuration.
url_patternsnative
Aggregate URL resolver traits from endpoint view modules.
viewsetnative
Generate URL resolver traits for a ViewSet function.

Derive Macros§

AppConfigcore and native
Derive macro for automatic AppConfig factory method generation
DeriveApplyUpdatenative
Derive macro for automatic ApplyUpdate trait implementation
Modeldatabase and native
Derive macro for automatic Model implementation and migration registration
Schemaopenapi and native
Derive macro for automatic OpenAPI schema generation.
Validatecore and native
Derive macro for struct-level validation