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- All features enabled (opt-in for the broadest surface area)standard(default) - Balanced for most projectsapi-only- REST API without templates/formsgraphql-server- GraphQL-focused setupwebsocket-server- WebSocket-centric setupcli-tools- CLI and background jobstest-utils- Testing utilities
§Fine-grained Control
Fine-grained feature flags for precise control over included functionality:
§Authentication ✅
auth-jwt- JWT authenticationauth-session- Session-based authenticationauth-oauth- OAuth2 supportauth-social- Social authentication providersauth-token- Token authentication
§Database Backends ✅
db-postgres- PostgreSQL supportdb-mysql- MySQL supportdb-sqlite- SQLite supportdb-cockroachdb- CockroachDB support (distributed transactions)
§Middleware ✅
middleware-cors- CORS (Cross-Origin Resource Sharing) middlewaremiddleware-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§
- accept
- Accept header parsing
- admin
nativeandadmin - Admin panel functionality
- apps
nativeandcore - Application configuration and registry module.
- auth
nativeandauth - Authentication and authorization APIs re-exported by the facade crate.
- auto_
schema openapi - Automatic schema generation from Rust types
- browsable_
api browsable-apiorfullorreinhardt-browsable-api - Browsable API for Reinhardt
- cache
- Caching for negotiation results
- commands
nativeandcommands - Management commands for Reinhardt framework
- conf
nativeandconf - Configuration and settings module.
- core
nativeandcore - Core framework types and utilities module.
- db
nativeanddatabase - Database re-exports for Model derive macro generated code.
- deeplink
nativeanddeeplink - Mobile deep linking module.
- dentdelion
nativeanddentdelion - Plugin system module.
- detector
- Content-Type detection from request body
- di
nativeanddi - Dependency injection module.
- dispatch
nativeanddispatch - Request dispatching module.
- encoding
- Encoding negotiation based on Accept-Encoding header
- endpoint_
inspector openapi - Endpoint Inspector for Function-Based Routes
- endpoints
openapi - OpenAPI endpoint handlers for automatic documentation mounting
- enum_
schema openapi - Advanced enum schema generation
- filters
- Type-safe filtering backends for Reinhardt framework
- forms
nativeandforms - Forms and validation module.
- generator
openapi - OpenAPI schema generator with registry integration
- graphql
nativeandgraphql - GraphQL API module.
- grpc
nativeandgrpc - gRPC service module.
- http
nativeandcore - HTTP request and response types module.
- i18n
nativeandi18n - Internationalization module.
- injectable
di - Injectable trait for dependencies
- injectable_
key di - Key marker trait for keyed dependency providers.
- inventory
openapi - github crates-io docs-rs
- language
- Language negotiation based on Accept-Language header
- mail
nativeandmail - Email sending module.
- media_
type - Media type representation
- metadata
- Reinhardt Metadata
- middleware
nativeand (middlewareorstandard) - Middleware module.
- migrations
nativeanddatabase - Reinhardt Migrations
- model_
info - Target-neutral metadata traits emitted by model macros.
- negotiation
- Content negotiation for request/response formats. Content negotiation for Reinhardt
- negotiator
- Content negotiator
- openapi
openapi - OpenAPI 3.0 types with Reinhardt extensions
- pages
pages - WASM-based reactive frontend framework with SSR
- pagination
- Pagination strategies (page-based, cursor, limit-offset).
- param_
metadata openapi - Parameter metadata extraction for OpenAPI schema generation
- parsers
api-onlyorcompressed-parsersorfullorrestorstandard - Request body parsers (JSON, form, multipart, etc.).
- prelude
- Cross-target prelude for
reinhardt. - prelude
- Re-export commonly used types
- query
nativeanddatabase - SQL query builder module.
- redirect
shortcuts - HTTP redirect helpers (temporary and permanent). Redirect shortcut functions
- registry
openapi - Schema registry for managing reusable component schemas
- rest
nativeandrest - REST API module.
- reverse
native - URL reverse resolution (name-to-URL mapping).
URL reverse resolution — inspired by Django’s
django.urls.reverse(). - schema_
registration openapi - Compile-time schema registration infrastructure
- serde_
attrs openapi - Serde attributes integration for OpenAPI schema generation
- serializers
api-onlyorapiorfullorrestorstandard - Reinhardt Serializers
- server
nativeandserver - Server module - HTTP/HTTP2/WebSocket server implementations
- shortcuts
nativeandshortcuts - Shortcut functions for common operations.
- streaming
streaming - Streaming module.
- swagger
openapi - Swagger UI integration
- tasks
nativeandtasks - Background tasks module.
- template
nativeandtemplates - Template and rendering module.
- test
test - Testing utilities module.
- throttling
- Rate limiting for Reinhardt framework
- urls
nativeandrouting - URL routing module.
- utils
nativeand (cacheorstatic-filesorstorage) - Utility functions module.
- utoipa
openapi - 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.
- versioning
- Reinhardt Versioning
- views
nativeand (api-onlyorapiorstandard) - Views module.
Macros§
- collect_
migrations nativeanddatabase - Collect migrations and register them with the global registry
- flatten_
imports native - Function-like proc macro for multi-file view modules.
- installed_
apps - Defines installed applications with compile-time validation.
- path
native - Validates URL path syntax at compile time.
Structs§
- APIClient
nativeandtest - Test client for making API requests
- APIRequest
Factory nativeandtest - Factory for creating test requests
- APITest
Case nativeandtest - Base test case for API testing
- Abs
- Abs - absolute value
- Accept
Header Versioning - Accept header versioning
- Action
- Action metadata
- Action
Metadata - Action metadata (for POST, PUT, etc.)
- Aggregate
- Aggregate expression
- Allow
Any - AllowAny - grants permission to all requests
- Annotation
- Represents an annotation on a QuerySet
- Anon
Rate Throttle - Rate throttle for anonymous (unauthenticated) requests.
- AppConfig
nativeandcore - Configuration for a single application
- Apps
nativeandcore - Main application registry
- Argon2
Hasher argon2-hasherandauth - Argon2id password hasher (recommended for new applications)
- Array
Builder openapi - Builder for
Arraywith chainable configuration methods to create a newArray. - Auth
Info - Lightweight authentication extractor that reads from request extensions.
- Authentication
Middleware middlewareandsessions - Authentication middleware Extracts user information from session and attaches it to request extensions
- BTree
Index - B-Tree index (default)
- Base
Negotiator - Base content negotiation implementation (abstract)
- Body
diorminimalorstandard - Extract the raw request body as bytes
- Bound
Field - BoundField represents a field bound to form data
- Broadcast
Result - Result of a broadcast operation that tracks individual send outcomes.
- Cache
KeyBuilder nativeandcache - Cache key builder for generating cache keys
- Cache
Middleware middleware - Cache Middleware
- Cache
Session Backend nativeandsessions - Cache-based session backend
- Cache
Settings - Cache configuration fragment.
- Cast
- Cast expression - convert a value to a specific type
- Ceil
- Ceil - round up to nearest integer
- Char
Field - Character field with length validation
- Check
Constraint - CHECK constraint (similar to Django’s CheckConstraint)
- Choice
Info - Choice information for choice fields
- Claims
auth-jwt - JWT Claims
- Client
Path client-router - Single path parameter extractor.
- Client
Path Pattern client-router - Represents a compiled path pattern.
- Client
Route client-router - A single route definition.
- Client
Route Match client-router - A matched route with extracted parameters.
- Client
Router client-router - The main client-side router.
- Components
openapi - Implements OpenAPI Components Object which holds supported reusable objects.
- Concat
- Concat - concatenate multiple strings
- Connection
Pool - A database connection pool
- Consumer
Context - Consumer context containing connection and message information
- Content
Negotiator - Content negotiator for selecting appropriate renderer
- Content
Type - Represents a content type (model) in the system
- Content
Type Registry - Registry for managing content types
- Cookie
diorminimalorstandard - Extract a value from cookies
- Cookie
Named diorminimalorstandard - Extract a value from cookies with compile-time name specification
- Cookie
Param openapi - Marker type for Cookie parameter metadata
- Cookie
Session Auth Middleware middlewareandsessions - Middleware that authenticates requests via a session cookie.
- Cookie
Session Config middlewareandsessions - Configuration for cookie-based session authentication.
- Cookie
Struct diorminimalorstandard - CookieStruct extracts multiple cookies into a struct
- Core
Settings - Core application settings.
- Cors
Middleware middleware-cors - CORS middleware
- Cors
Settings - CORS configuration fragment.
- Create
Group Data - Group creation data
- Create
User Data - User data for creation
- Credit
Card Validator nativeandcore - Credit card number validator
- CspConfig
middlewareorstandard - CSP directive configuration
- CspMiddleware
middlewareorstandard - Content Security Policy middleware
- CspNonce
middlewareorstandard - Type wrapper for CSP nonce stored in Request extensions
- Current
Date - CurrentDate - current date
- Current
Time - CurrentTime - current time
- Current
User - Authenticated user extractor that loads the full user model from database.
- Cursor
Pagination - Cursor-based pagination for large datasets
- Database
Config - Database configuration
- Database
Connection - Database connection wrapper
- Default
Router native - Default router implementation Similar to Django REST Framework’s DefaultRouter and Django’s URLResolver
- Default
Source - Default values configuration source
- Dense
Rank - DENSE_RANK window function
- Depends
di - Dependency injection wrapper for keyed provider output.
- Depends
Builder di - Builder for
Dependswith a metadata cache flag recorded on the resolved wrapper. - Detail
View - DetailView for displaying a single object
- Email
Field - Email field with format validation
- Email
Settings - Email configuration fragment.
- Email
Validator nativeandcore - Email address validator
- Endpoint
Inspector openapi - Endpoint inspector for function-based routes
- Endpoint
Metadata nativeandcore - Endpoint metadata for OpenAPI generation
- Enum
Schema Builder openapi - Builder for enum schemas
- EnvSource
- Environment variable configuration source
- Exists
- Exists - check if a subquery returns any rows
- Extensions
nativeandcore - Type-safe extension storage
- Extract
- Extract component from date/time
- F
- F expression - represents a database field reference Similar to Django’s F() objects for database-side operations
- Factory
Output di - Registered output of a keyed provider function.
- Field
Assignment - One field assignment for a partial
QuerySetupdate. - Field
Info - Field metadata information
- Field
Info Builder - Builder for field information
- Field
Metadata openapi - Field metadata extracted from serde attributes
- Field
Ref - Type-safe field reference for database operations
- Field
State - Field state for migration detection
- File
Field - FileField for file upload
- File
Upload Parser api-onlyorcompressed-parsersorfullorrestorstandard - Raw file upload parser
- Filter
- Represents a filter.
- First
Value - FIRST_VALUE window function
- Floor
- Floor - round down to nearest integer
- Foreign
KeyConstraint - Foreign Key constraint
- Form
- Form data structure (Phase 2-A: Enhanced with client-side validation rules)
- Form
Parser api-onlyorcompressed-parsersorfullorrestorstandard - Form parser for application/x-www-form-urlencoded content type
- Frame
- Window frame specification
- Generic
Foreign Key - Generic foreign key field
- Generic
Relation Query - Helper for building generic relation queries
- Generic
View Set - Generic ViewSet without built-in CRUD logic.
- GinIndex
- GIN index (for arrays, JSONB, full-text search)
- Gist
Index - GiST index (for geometric data, full-text search)
- Greatest
- Greatest - return the maximum value among expressions
- Group
- User group
- Group
Manager - Group manager
- Hash
Index - Hash index
- Header
nativeand (diorminimalorstandard) - Extract a value from request headers
- Header
openapi - Implements OpenAPI Header Object for response headers.
- Header
Param openapi - Marker type for Header parameter metadata
- History
State client-router - State object stored in the history entry.
- Host
Name Versioning - Hostname versioning
- Http
Session Config nativeandmiddlewareandsessions - HTTP session configuration
- IBAN
Validator nativeandcore - IBAN validator implementing ISO 13616 standard
- IPAddress
Validator nativeandcore - IP Address validator - validates IPv4 and IPv6 addresses using std::net::IpAddr
- InMemory
Cache nativeandcache - In-memory cache backend
- InMemory
Session Backend nativeandsessions - In-memory session backend
- InMemory
Storage nativeandstorage - In-memory storage backend
- Index
- Index definition
- Info
openapi - OpenAPI Info object represents metadata of the API.
- Injection
Context di - The main injection context for dependency resolution.
- Injection
Context Builder di - Builder for constructing
InjectionContextinstances. - Injection
Metadata di - Injection metadata
- Integer
Field - Integer field with range validation
- IsAdmin
User - IsAdminUser - requires the user to be an admin
- IsAuthenticated
- IsAuthenticated - requires the user to be authenticated
- JSON
Parser api-onlyorcompressed-parsersorfullorrestorstandard - JSON parser for application/json content type
- Json
diorminimalorstandard - Extract and deserialize JSON from request body
- Json
Serializer api-onlyorapiorfullorrestorstandard - JSON serializer implementation
- JwtAuth
auth-jwt - JWT Authentication handler
- JwtAuth
Middleware middleware-auth-jwt - JWT authentication middleware for stateless token-based auth.
- Lag
- LAG window function
- Last
Value - LAST_VALUE window function
- Lead
- LEAD window function
- Least
- Least - return the minimum value among expressions
- Length
- Length - return the length of a string
- Limit
Offset Pagination - Limit/offset based pagination
- List
View - ListView for displaying multiple objects
- Local
Storage nativeandstorage - Local filesystem storage
- Logging
Middleware middlewareorstandard - Django-style request logging middleware with colored output
- Logging
Settings - Logging configuration fragment.
- Login
Required Config middlewareorstandard - Configuration for
LoginRequiredMiddleware. - Login
Required Middleware middlewareorstandard - Login required middleware.
- LowPriority
EnvSource - Low-priority environment variable configuration source
- Lower
- Lower - convert string to lowercase
- M2MChange
Event nativeandsignals - M2M changed signal - sent when many-to-many relationships change
- Media
Settings - Media files configuration fragment.
- Media
Type openapi - Represents a media type (MIME type)
- Metadata
Options - Options for configuring metadata
- Metadata
Response - Complete metadata response
- Method
native - The Request Method (VERB)
- Middleware
Chain nativeandcore - Middleware chain - composes multiple middleware into a single handler.
- Middleware
Config - Middleware configuration
- Migration
- A database migration
- Migration
Autodetector - Migration autodetector
- Migration
Plan - Migration execution plan
- Migration
Recorder - Migration recorder (in-memory only, for backward compatibility)
- Mod
- Mod - modulo operation
- Model
Form - A form that is automatically generated from a Model
- Model
State - Model state for migration detection
- Model
View Set ModelViewSet- combines all CRUD mixins, backed by a realModelViewSetHandlerfor database-backed CRUD.- Multi
Part Parser api-onlyorcompressed-parsersorfullorrestorstandard - MultiPart parser for multipart/form-data content type (file uploads)
- Multi
Term Search api-onlyorapiorfullorrestorstandard - Combines multiple search terms across multiple fields
- NTile
- NTILE window function
- Namespace
Versioning - Namespace versioning (URL namespace-based)
- Now
- Now - current timestamp
- NthValue
- NTH_VALUE window function
- NullIf
- NullIf - return NULL if two expressions are equal
- Object
Builder openapi - Builder for
Objectwith chainable configuration methods to create a newObject. - Object
Permission - Object permission with
Permissiontrait support - Object
Permission Manager - Object permission manager
- Open
ApiRouter openapi-router - Router wrapper that adds OpenAPI documentation endpoints
- Open
ApiSchema openapi - Root object of the OpenAPI document.
- Operation
openapi - Implements OpenAPI Operation Object object.
- Optional
Session Value middlewareandsessions - Optional typed session-value extractor.
- Origin
Guard Middleware middlewareorstandard - Middleware that validates the
OriginorRefererheader on state-changing requests as a CSRF protection layer. - Outer
Ref - OuterRef - reference to a field in the outer query (for subqueries)
- Page
Number Pagination - Page number based pagination
- Pages
Authenticator websockets-pages - Authenticator that integrates with reinhardt-pages’ Cookie/session authentication
- Paginated
Response - Paginated response wrapper
- Param
Context client-router - Context for parameter extraction.
- Parameter
openapi - Implements OpenAPI Parameter Object for
Operation. - Parser
Media Type api-onlyorcompressed-parsersorfullorrestorstandard - Media type representation
- Path
diorminimalorstandard - Extract typed values from URL path parameters.
- Path
Item openapi - Implements OpenAPI Path Item Object what describes
Operations available on a single path. - Path
Matcher native - Path matcher - uses composition to match paths
- Path
Param openapi - Marker type for Path parameter metadata
- Path
Pattern native - Path pattern for URL matching Similar to Django’s URL patterns but using composition
- Persistent
Remote User Middleware middlewareandsessions - Persistent remote user authentication middleware.
- Phone
Number Validator nativeandcore - Phone number validator for international phone numbers
- Pool
Config - Represents a pool config.
- Power
- Power - raise to a power
- Project
State - Project state for migration detection
- Query
diorminimalorstandard - Extract query parameters from the URL
- Query
Param openapi - Marker type for Query parameter metadata
- Query
Parameter Versioning - Query parameter versioning
- Query
Set - Represents a query set.
- Rank
- RANK window function
- Read
Only Model View Set ReadOnlyModelViewSet- exposes onlylistandretrieveagainst a realModelViewSetHandler.- Redis
Cache nativeandcacheandredis-backend - Redis cache backend with connection pooling
- Redis
Session Backend middlewareandsession-redis - Session backend backed by Redis.
- RedocUI
openapi - Redoc UI handler (alternative to Swagger UI)
- Remote
User Middleware middlewareandsessions - Remote user authentication middleware.
- Renderer
Info - Renderer information for testing
- Request
nativeandcore - HTTP Request representation
- Request
Body openapi - Implements OpenAPI Request Body.
- Request
Context di - Context for per-request dependency injection resolution.
- Request
Scope di - Per-request dependency cache that stores resolved instances for the duration of a request.
- Response
nativeandcore - HTTP Response representation
- Response
openapi - Implements OpenAPI Response Object.
- Room
- A WebSocket room that manages multiple client connections
- Room
Manager - Manages multiple WebSocket rooms
- Round
- Round - round to specified decimal places
- Route
native - Route definition Uses composition to combine path patterns with handlers Similar to Django’s URLPattern
- RowNumber
- ROW_NUMBER window function
- Savepoint
- Savepoint for nested transactions
- Scheduler
nativeandtasks - Task scheduler for managing periodic tasks
- Schema
Builder Ext openapi - Schema builder with serde attribute support
- Schema
Generator openapi - Schema generator for OpenAPI schemas
- Schema
Registration openapi - Compile-time schema registration metadata
- Schema
Registry openapi - A registry for managing reusable OpenAPI schemas
- Scoped
Rate Throttle - Scope-based rate throttle with per-scope rate limits.
- Security
Middleware middleware-security - Security middleware for HTTP security headers and redirects
- Security
Settings - Security-related configuration settings.
- Server
openapi - Represents target server object. It can be used to alter server connection for path operations.
- Server
Router native - Unified router with hierarchical routing support
- Session
nativeandsessions - Django-style session object with dictionary-like interface
- Session
Middleware nativeandmiddlewareandsessions - Session middleware
- Session
Settings - Session configuration fragment.
- Session
Value middlewareandsessions - Required typed session-value extractor.
- Session
Value Named middlewareandsessions - Typed session-value extractor parameterised by a
SessionKey. - Settings
Builder - Settings builder for layered configuration
- Signal
nativeandsignals - A signal that can dispatch events to connected receivers
- Simple
Metadata - Simple metadata implementation
- Singleton
Scope di - Application-wide dependency cache that persists across all requests.
- Soft
Delete - Soft delete field that can be composed into structs
- Sqrt
- Sqrt - square root
- Static
Settings - Static files configuration fragment.
- Status
Code native - An HTTP status code (
status-codein RFC 9110 et al.). - Subquery
- Subquery - represents a subquery expression
- Substr
- Substr - extract a substring
- SwaggerUI
openapi - Swagger UI handler
- Tag
openapi - Implements OpenAPI Tag Object.
- Task
Queue nativeandtasks - A task queue that delegates to a backend for task storage and retrieval.
- Template
Config Deprecated - Template engine configuration
- Test
Response nativeandtest - Test response wrapper
- Timestamps
- Common timestamp fields that can be composed into structs
- Toml
File Source - TOML file configuration source
- Transaction
- Transaction manager
- Transaction
Scope - Transaction scope guard with automatic rollback on drop
- Trim
- Trim - remove leading and trailing whitespace
- URLPath
Versioning - URL path versioning
- Unified
Router client-router - Unified router combining server and client routing capabilities.
- Unique
Constraint - UNIQUE constraint (similar to Django’s UniqueConstraint)
- Update
User Data - User data for update
- Upper
- Upper - convert string to uppercase
- UrlPatterns
Registration native - URL patterns registration for compile-time discovery
- UrlReverser
native - URL reverser for resolving names back to URLs Similar to Django’s URLResolver reverse functionality
- UrlValidator
nativeandcore - URL validator
- User
IdKey middlewareandsessions - Default marker pointing at
USER_ID_SESSION_KEY— the authenticated user’s primary key in every Reinhardt example app. - User
Manager - User manager
- User
Rate Throttle - Rate throttle for authenticated user requests.
- Validation
Errors nativeandcore - Aggregates validation errors by field name.
- Versioning
Middleware - Middleware for automatic API version detection
- WebSocket
Connection - WebSocket connection with activity tracking and timeout support
- WebSocket
Route - A registered WebSocket route (path + optional name + metadata).
- WebSocket
Router - WebSocket router: build-time registration + runtime lookup.
- Window
- Window specification
- XFrame
Options Middleware middlewareorstandard - X-Frame-Options middleware for clickjacking protection
Enums§
- Action
Type - Action type for ViewSet operations
- Aggregate
Func - Aggregate function types
- Aggregate
Value - Result of an aggregation
- Annotation
Value - Represents an annotation value that can be added to a QuerySet
- AppError
nativeandcore - Errors that can occur when working with the application registry
- Database
Backend - Defines possible database backend values.
- DiError
di - Errors that can occur during dependency injection resolution.
- Enum
Tagging openapi - Enum tagging strategy
- Error
nativeandcore - The main error type for the Reinhardt framework.
- Extract
Component - Defines possible extract component values.
- Field
Error - Error type returned when field validation fails.
- Field
Type - Field type enumeration for metadata
- Filter
Error - Errors that can occur during query filtering.
- Filter
Operator - Defines possible filter operator values.
- Filter
Value - Defines possible filter value values.
- Form
Error - Error type returned when form-level validation fails.
- Frame
Boundary - Frame boundary
- Frame
Type - Window frame type
- Group
Management Error - Group management error
- Isolation
Level - Transaction isolation levels
- JwtError
auth-jwt - JWT-specific errors with distinct variants for each failure mode.
- M2MAction
nativeandsignals - Actions that can occur on a many-to-many relationship.
- Merge
Error client-router - Error returned by
ClientRouter::try_mergewhen two routers cannot be combined without silently shadowing a named route. - Message
- WebSocket message types
- Migration
Error - Errors that can occur during migration operations.
- Navigation
Type client-router - The type of navigation that occurred.
- Negotiation
Error - Error type for negotiation failures
- Number
openapi - Flexible number wrapper used by validation schema attributes to seamlessly support different number syntaxes.
- OnDelete
- Defines possible on delete values.
- OnUpdate
- Defines possible on update values.
- Order
- Ordering direction for ORDER BY clauses.
- Parameter
Location openapi - In definition of
Parameter. - Pool
Error - Defines possible pool error values.
- Profile
- Application profile/environment
- Q
- Q object - represents a complex query condition Similar to Django’s Q() objects for building complex queries
- QOperator
- Q operator for combining query conditions
- Query
Builder Value - Core value representation for SQL parameters.
- Query
Value - Query value types
- RefOr
openapi - A
Refor some other typeT. - Rename
All openapi - Rename transformation strategy
- Required
openapi - Value used to indicate whether parameter or property is required.
- Room
Error - Error types for room operations
- Route
Error - Routing errors for WebSocket routes
- Router
Factory native - Factory for creating server routers, supporting both sync and async creation.
- Same
Site nativeandmiddlewareandsessions - SameSite cookie attribute
- Schema
openapi - Is super type for OpenAPI Schema Object. Schema is reusable resource what can be
referenced from path operations and other components using
Ref. - Schema
Error openapi - Errors that can occur during OpenAPI schema operations.
- Scope
di - Defines the lifetime scope of a dependency.
- Session
Error nativeandsessions - Session backend errors
- SqlType
- Defines possible sql type values.
- Trim
Type - Defines possible trim type values.
- Update
Value - Values that can be used in UPDATE statements
- User
Management Error - User management error
- Validator
Error nativeandcore - Validation errors produced by validators.
- Versioning
Error - Errors that can occur during API version determination.
- WebSocket
Error - Errors that can occur during WebSocket operations.
- XFrame
Options middlewareorstandard - X-Frame-Options values
Constants§
- USER_
ID_ SESSION_ KEY middlewareandsessions - Canonical session-store key used by Reinhardt examples to persist the authenticated user’s primary key after a successful login.
Statics§
- CONTENT_
TYPE_ REGISTRY - Global content type registry.
Traits§
- Apply
Update - Trait for applying partial updates from one struct to another.
- Auth
Backend - Unified authentication backend trait
- Auth
Identity - Authentication identity trait - replacement for the deprecated
Usertrait. - Base
Content Negotiation - Base content negotiator trait
- Base
Metadata - Base trait for metadata providers
- Base
User - BaseUser trait - Django-style authentication
- Base
Versioning - Base trait for API versioning strategies
- Cache
nativeandcache - Base cache trait
- Client
UrlResolver - Trait for resolving client-side (frontend) URLs by route name.
- Components
Ext openapi - Extension trait for Components to provide convenient methods
- Constraint
- Base trait for all constraints
- Cookie
Name diorminimalorstandard - Marker trait for cookie names.
- Create
Mixin - Create mixin - provides create() action
- Deserialize
nativeandcore - A data structure that can be deserialized from any data format supported by Serde.
- Deserializer
api-onlyorapiorfullorrestorstandard - Deserializer trait for one-way deserialization
- Destroy
Mixin - Destroy mixin - provides destroy() action
- Field
Ordering Ext api-onlyorapiorfullorrestorstandard - Extension trait to add ordering methods to Field
- Filter
Backend - A backend that applies query parameter filters to a SQL query string.
- From
Path client-router - Trait for extracting typed values from path parameters.
- Full
User - FullUser trait - Django’s AbstractUser equivalent
- Generic
Relatable - Trait for models that can be targets of generic relations
- Handler
nativeandcore - Handler trait for processing requests.
- HasCore
Settings - Trait for accessing the settings fragment from a composed settings type.
- HasSettings
- Generic accessor trait for settings fragments.
- Http
Error nativeandcore - Application-defined error contract for HTTP response mapping.
- Injectable
di - Injectable trait for dependencies.
- Injectable
Key di - Marker trait for dependency provider keys.
- Into
Value - Trait for converting Rust types to SQL values.
- List
Mixin - Mixin traits for ViewSet functionality These use composition instead of multiple inheritance List mixin - provides list() action
- Middleware
nativeandcore - Middleware trait for request/response processing.
- Model
- Core trait for database models Uses composition instead of inheritance - models can implement multiple traits
- Model
Type - Trait for models that can be registered as content types
- Multiple
Object Mixin - Trait for views that work with multiple objects
- Object
Permission Checker - Object permission checker trait
- Open
ApiSchema Ext openapi - Extension trait for OpenApiSchema to provide convenient methods
- Operation
Ext openapi - Extension trait for Operation to provide convenient methods
- Paginator
- Trait for pagination implementations
- Parameter
Ext openapi - Extension trait for Parameter to provide convenient constructors
- Parameter
Metadata openapi - Trait for types that can provide OpenAPI parameter metadata
- Parser
api-onlyorcompressed-parsersorfullorrestorstandard - Trait for request body parsers
- Password
Hasher - Password hasher trait
- Path
Item Ext openapi - Extension trait for PathItem to provide constructor
- Permission
- Permission trait - defines permission checking interface
- Permissions
Mixin - PermissionsMixin trait - Django’s PermissionsMixin equivalent
- Request
Version Ext - Extension trait to get API version from request
- Responses
Ext openapi - Extension trait for Responses to provide collection methods
- Retrieve
Mixin - Retrieve mixin - provides retrieve() action
- Router
native - Router trait - composes routes together
- Schema
Ext openapi - Extension trait for Schema to provide convenient constructor methods
- Serialize
nativeandcore - A data structure that can be serialized into any data format supported by Serde.
- Serializer
api-onlyorapiorfullorrestorstandard - Core serializer trait for converting between input and output representations
- Session
Auth Ext middlewareandsessions - Login/logout helpers for
SessionData. - Session
Backend nativeandsessions - Session backend trait
- Session
Key middlewareandsessions - Marker trait identifying a session-storage key at the type level.
- Settings
Fragment - A rootable composable unit of configuration.
- Single
From Path client-router - Trait for extracting a single value at a specific index from path parameters.
- Single
Object Mixin - Trait for views that work with a single object
- Soft
Deletable - Trait for soft-deletable models Another composition trait instead of inheritance
- Storage
nativeandstorage - Trait for file storage backends
- Task
nativeandtasks - Core trait that all tasks must implement, providing identity and metadata.
- Task
Executor nativeandtasks - Trait for tasks that can be executed asynchronously.
- Throttle
- Core trait for rate-limiting strategies.
- Timestamped
- Trait for models with timestamps - compose this with Model This follows Rust’s composition pattern rather than Django’s inheritance
- ToSchema
openapi - Trait for types that can generate OpenAPI schemas
- Transaction
Executor - Transaction executor trait for database-specific transaction handling
- Update
Mixin - Update mixin - provides update() action
- UrlResolver
native - Base trait for type-safe URL resolution.
- Validate
nativeandcore - Trait for struct-level validation.
- Validator
nativeandcore - Trait for validators
- View
- Base trait for all generic views
- ViewSet
- ViewSet trait - similar to Django REST Framework’s ViewSet Uses composition of mixins instead of inheritance
- WebSocket
Consumer - WebSocket consumer trait
- WebSocket
UrlResolver native - Trait for resolving WebSocket endpoint URLs by route name.
- Window
Function - Base trait for window functions
Functions§
- atomic
- Execute a function within a transaction scope
- atomic_
with_ isolation - Execute a function within a transaction with specific isolation level
- clear_
router native - Clear the registered router (useful for tests)
- clear_
websocket_ router - Clears the process-wide WebSocket router (primarily for tests).
- generate_
openapi_ schema openapi - Generate OpenAPI schema from global registry
- get_
list_ or_ 404 databaseandshortcuts - Get a list of objects from the database or return a 404 response if empty
- get_
object_ or_ 404 databaseandshortcuts - Get a single object from the database or return a 404 response
- get_
router native - Get a reference to the globally registered router
- get_
websocket_ router - Returns a clone of the current process-wide WebSocket router, if set.
- include
native - Create an IncludedRouter from a list of routes Similar to Django’s include() function
- is_
router_ registered native - Check if a router has been registered
- m2m_
changed nativeandsignals - Returns the M2M changed signal for the given model types.
- path
native - Create a route using simple path syntax Similar to Django’s path() function
- post_
delete nativeandsignals - Post-delete signal - sent after a model instance is deleted
- post_
save nativeandsignals - Post-save signal - sent after a model instance is saved
- pre_
delete nativeandsignals - Pre-delete signal - sent before a model instance is deleted
- pre_
save nativeandsignals - Pre-save signal - sent before a model instance is saved
- re_path
native - Create a route using regex syntax Similar to Django’s re_path() function
- redirect
shortcuts - Create a validated temporary redirect (HTTP 302) to the specified URL.
- register_
router native - Register the application’s main router globally
- register_
router_ arc native - Register a router that is already wrapped in Arc.
- register_
websocket_ router - Installs
routeras the process-wide WebSocket router. - render_
html shortcuts - Render a simple HTML string and return an HTTP 200 response
- render_
json shortcuts - Render data as JSON and return an HTTP 200 response, or an error if serialization fails
- render_
text shortcuts - Render a simple text string and return an HTTP 200 response
- reverse
native - Standalone reverse function for convenience Similar to Django’s reverse() function
- reverse_
websocket_ url - Resolves a registered or pending WebSocket URL by route name.
- validate_
auth_ extractors - Validates that the DI context is properly configured for auth extractors.
Type Aliases§
- AppResult
nativeandcore - A specialized
Resulttype for application operations. - Context
- Context data for template rendering
- DiResult
di - A specialized
Resulttype for dependency injection operations. - Filter
Result - A convenience type alias for filter operation results.
- Form
Result - Result type alias for form-level operations.
- Group
Management Result - Group management result
- Parse
Error api-onlyorcompressed-parsersorfullorrestorstandard - Type alias for parser errors, using the framework’s
Errortype. - Parse
Result api-onlyorcompressed-parsersorfullorrestorstandard - Type alias for parser results, using the framework’s
Resulttype. - Result
nativeandcore - A convenient
Resulttype alias usingreinhardt_core::exception::Erroras the error type. - Room
Result - A specialized
Resulttype for room operations. - Route
Result - Routing result type
- Schema
Object openapi - A complete schema object with metadata This is an alias to utoipa’s Schema for convenience
- Schema
Result openapi - Result type for OpenAPI schema operations.
- User
Management Result - User management result
- Validation
Result nativeandcore - Result type for validation operations.
- View
Result nativeandcore - A convenient type alias for view/endpoint function return types.
- WebSocket
Result - A specialized
Resulttype for WebSocket operations.
Attribute Macros§
- admin
nativeandadmin - Attribute macro for ModelAdmin configuration
- api_
view native - Decorator for function-based API views
- app_
config - Attribute macro for Django-style AppConfig definition with automatic derive
- apply_
update native - Attribute macro for applying partial updates to target structs
- async_
trait native - delete
native - DELETE method decorator
- dto
- Attribute macro that absorbs the
cfg_attr(native, ...)boilerplate for DTOs shared between the server (nativecfg) and client (wasm) builds. - get
native - GET method decorator.
- injectable
di - Register an injectable provider function.
- injectable_
key di - Mark a type as a dependency provider key.
- model
- Attribute macro for Django-style model definition with automatic derive
- patch
native - PATCH method decorator
- post
native - POST method decorator
- put
native - PUT method decorator
- routes
- Register URL patterns for automatic discovery by the framework
- settings
nativeandconf - Settings attribute macro for composable configuration.
- user
- Attribute macro for generating auth trait implementations.
- viewset
native - Generate URL resolver traits for a ViewSet function.
Derive Macros§
- AppConfig
- Derive macro for automatic AppConfig factory method generation
- Derive
Apply Update native - Derive macro for automatic
ApplyUpdatetrait implementation - Deserialize
nativeandcore - Http
Error - Implements HTTP status and client-message mapping for application error enums.
- Model
- Derive macro for automatic Model implementation and migration registration
- Schema
openapi - Derive macro for automatic OpenAPI schema generation.
- Serialize
nativeandcore - Validate
nativeandcore - Derive macro for struct-level validation