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 - All features enabled (opt-in for the broadest surface area)
  • standard (default) - 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-social - Social authentication providers
  • 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§

accept
Accept header parsing
adminnative and admin
Admin panel functionality
appsnative and core
Application configuration and registry module.
authnative and auth
Authentication and authorization APIs re-exported by the facade crate.
auto_schemaopenapi
Automatic schema generation from Rust types
browsable_apibrowsable-api or full or reinhardt-browsable-api
Browsable API for Reinhardt
cache
Caching for negotiation results
commandsnative and commands
Management commands for Reinhardt framework
confnative and conf
Configuration and settings module.
corenative and core
Core framework types and utilities module.
dbnative and database
Database re-exports for Model derive macro generated code.
deeplinknative and deeplink
Mobile deep linking module.
dentdelionnative and dentdelion
Plugin system module.
detector
Content-Type detection from request body
dinative and di
Dependency injection module.
dispatchnative and dispatch
Request dispatching module.
encoding
Encoding negotiation based on Accept-Encoding header
endpoint_inspectoropenapi
Endpoint Inspector for Function-Based Routes
endpointsopenapi
OpenAPI endpoint handlers for automatic documentation mounting
enum_schemaopenapi
Advanced enum schema generation
filters
Type-safe filtering backends for Reinhardt framework
formsnative and forms
Forms and validation module.
generatoropenapi
OpenAPI schema generator with registry integration
graphqlnative and graphql
GraphQL API module.
grpcnative and grpc
gRPC service module.
httpnative and core
HTTP request and response types module.
i18nnative and i18n
Internationalization module.
injectabledi
Injectable trait for dependencies
injectable_keydi
Key marker trait for keyed dependency providers.
inventoryopenapi
githubcrates-iodocs-rs
language
Language negotiation based on Accept-Language header
mailnative and mail
Email sending module.
media_type
Media type representation
metadata
Reinhardt Metadata
middlewarenative and (middleware or standard)
Middleware module.
migrationsnative and database
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
openapiopenapi
OpenAPI 3.0 types with Reinhardt extensions
pagespages
WASM-based reactive frontend framework with SSR
pagination
Pagination strategies (page-based, cursor, limit-offset).
param_metadataopenapi
Parameter metadata extraction for OpenAPI schema generation
parsersapi-only or compressed-parsers or full or rest or standard
Request body parsers (JSON, form, multipart, etc.).
prelude
Cross-target prelude for reinhardt.
prelude
Re-export commonly used types
querynative and database
SQL query builder module.
redirectshortcuts
HTTP redirect helpers (temporary and permanent). Redirect shortcut functions
registryopenapi
Schema registry for managing reusable component schemas
restnative and rest
REST API module.
reversenative
URL reverse resolution (name-to-URL mapping). URL reverse resolution — inspired by Django’s django.urls.reverse().
schema_registrationopenapi
Compile-time schema registration infrastructure
serde_attrsopenapi
Serde attributes integration for OpenAPI schema generation
serializersapi-only or api or full or rest or standard
Reinhardt Serializers
servernative and server
Server module - HTTP/HTTP2/WebSocket server implementations
shortcutsnative and shortcuts
Shortcut functions for common operations.
streamingstreaming
Streaming module.
swaggeropenapi
Swagger UI integration
tasksnative and tasks
Background tasks module.
templatenative and templates
Template and rendering module.
testtest
Testing utilities module.
throttling
Rate limiting for Reinhardt framework
urlsnative and routing
URL routing module.
utilsnative and (cache or static-files or storage)
Utility functions module.
utoipaopenapi
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
viewsnative and (api-only or api or standard)
Views module.

Macros§

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

Structs§

APIClientnative and test
Test client for making API requests
APIRequestFactorynative and test
Factory for creating test requests
APITestCasenative and test
Base test case for API testing
Abs
Abs - absolute value
AcceptHeaderVersioning
Accept header versioning
Action
Action metadata
ActionMetadata
Action metadata (for POST, PUT, etc.)
Aggregate
Aggregate expression
AllowAny
AllowAny - grants permission to all requests
Annotation
Represents an annotation on a QuerySet
AnonRateThrottle
Rate throttle for anonymous (unauthenticated) requests.
AppConfignative and core
Configuration for a single application
Appsnative and core
Main application registry
Argon2Hasherargon2-hasher and auth
Argon2id password hasher (recommended for new applications)
ArrayBuilderopenapi
Builder for Array with chainable configuration methods to create a new Array.
AuthInfo
Lightweight authentication extractor that reads from request extensions.
AuthenticationMiddlewaremiddleware and sessions
Authentication middleware Extracts user information from session and attaches it to request extensions
BTreeIndex
B-Tree index (default)
BaseNegotiator
Base content negotiation implementation (abstract)
Bodydi or minimal or standard
Extract the raw request body as bytes
BoundField
BoundField represents a field bound to form data
BroadcastResult
Result of a broadcast operation that tracks individual send outcomes.
CacheKeyBuildernative and cache
Cache key builder for generating cache keys
CacheMiddlewaremiddleware
Cache Middleware
CacheSessionBackendnative and sessions
Cache-based session backend
CacheSettings
Cache configuration fragment.
Cast
Cast expression - convert a value to a specific type
Ceil
Ceil - round up to nearest integer
CharField
Character field with length validation
CheckConstraint
CHECK constraint (similar to Django’s CheckConstraint)
ChoiceInfo
Choice information for choice fields
Claimsauth-jwt
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.
Componentsopenapi
Implements OpenAPI Components Object which holds supported reusable objects.
Concat
Concat - concatenate multiple strings
ConnectionPool
A database connection pool
ConsumerContext
Consumer context containing connection and message information
ContentNegotiator
Content negotiator for selecting appropriate renderer
ContentType
Represents a content type (model) in the system
ContentTypeRegistry
Registry for managing content types
Cookiedi or minimal or standard
Extract a value from cookies
CookieNameddi or minimal or standard
Extract a value from cookies with compile-time name specification
CookieParamopenapi
Marker type for Cookie parameter metadata
CookieSessionAuthMiddlewaremiddleware and sessions
Middleware that authenticates requests via a session cookie.
CookieSessionConfigmiddleware and sessions
Configuration for cookie-based session authentication.
CookieStructdi or minimal or standard
CookieStruct extracts multiple cookies into a struct
CoreSettings
Core application settings.
CorsMiddlewaremiddleware-cors
CORS middleware
CorsSettings
CORS configuration fragment.
CreateGroupData
Group creation data
CreateUserData
User data for creation
CreditCardValidatornative and core
Credit card number validator
CspConfigmiddleware or standard
CSP directive configuration
CspMiddlewaremiddleware or standard
Content Security Policy middleware
CspNoncemiddleware or standard
Type wrapper for CSP nonce stored in Request extensions
CurrentDate
CurrentDate - current date
CurrentTime
CurrentTime - current time
CurrentUser
Authenticated user extractor that loads the full user model from database.
CursorPagination
Cursor-based pagination for large datasets
DatabaseConfig
Database configuration
DatabaseConnection
Database connection wrapper
DefaultRouternative
Default router implementation Similar to Django REST Framework’s DefaultRouter and Django’s URLResolver
DefaultSource
Default values configuration source
DenseRank
DENSE_RANK window function
Dependsdi
Dependency injection wrapper for keyed provider output.
DependsBuilderdi
Builder for Depends with a metadata cache flag recorded on the resolved wrapper.
DetailView
DetailView for displaying a single object
EmailField
Email field with format validation
EmailSettings
Email configuration fragment.
EmailValidatornative and core
Email address validator
EndpointInspectoropenapi
Endpoint inspector for function-based routes
EndpointMetadatanative and core
Endpoint metadata for OpenAPI generation
EnumSchemaBuilderopenapi
Builder for enum schemas
EnvSource
Environment variable configuration source
Exists
Exists - check if a subquery returns any rows
Extensionsnative and core
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
FactoryOutputdi
Registered output of a keyed provider function.
FieldAssignment
One field assignment for a partial QuerySet update.
FieldInfo
Field metadata information
FieldInfoBuilder
Builder for field information
FieldMetadataopenapi
Field metadata extracted from serde attributes
FieldRef
Type-safe field reference for database operations
FieldState
Field state for migration detection
FileField
FileField for file upload
FileUploadParserapi-only or compressed-parsers or full or rest or standard
Raw file upload parser
Filter
Represents a filter.
FirstValue
FIRST_VALUE window function
Floor
Floor - round down to nearest integer
ForeignKeyConstraint
Foreign Key constraint
Form
Form data structure (Phase 2-A: Enhanced with client-side validation rules)
FormParserapi-only or compressed-parsers or full or rest or standard
Form parser for application/x-www-form-urlencoded content type
Frame
Window frame specification
GenericForeignKey
Generic foreign key field
GenericRelationQuery
Helper for building generic relation queries
GenericViewSet
Generic ViewSet without built-in CRUD logic.
GinIndex
GIN index (for arrays, JSONB, full-text search)
GistIndex
GiST index (for geometric data, full-text search)
Greatest
Greatest - return the maximum value among expressions
Group
User group
GroupManager
Group manager
HashIndex
Hash index
Headernative and (di or minimal or standard)
Extract a value from request headers
Headeropenapi
Implements OpenAPI Header Object for response headers.
HeaderParamopenapi
Marker type for Header parameter metadata
HistoryStateclient-router
State object stored in the history entry.
HostNameVersioning
Hostname versioning
HttpSessionConfignative and middleware and sessions
HTTP session configuration
IBANValidatornative and core
IBAN validator implementing ISO 13616 standard
IPAddressValidatornative and core
IP Address validator - validates IPv4 and IPv6 addresses using std::net::IpAddr
InMemoryCachenative and cache
In-memory cache backend
InMemorySessionBackendnative and sessions
In-memory session backend
InMemoryStoragenative and storage
In-memory storage backend
Index
Index definition
Infoopenapi
OpenAPI Info object represents metadata of the API.
InjectionContextdi
The main injection context for dependency resolution.
InjectionContextBuilderdi
Builder for constructing InjectionContext instances.
InjectionMetadatadi
Injection metadata
IntegerField
Integer field with range validation
IsAdminUser
IsAdminUser - requires the user to be an admin
IsAuthenticated
IsAuthenticated - requires the user to be authenticated
JSONParserapi-only or compressed-parsers or full or rest or standard
JSON parser for application/json content type
Jsondi or minimal or standard
Extract and deserialize JSON from request body
JsonSerializerapi-only or api or full or rest or standard
JSON serializer implementation
JwtAuthauth-jwt
JWT Authentication handler
JwtAuthMiddlewaremiddleware-auth-jwt
JWT authentication middleware for stateless token-based auth.
Lag
LAG window function
LastValue
LAST_VALUE window function
Lead
LEAD window function
Least
Least - return the minimum value among expressions
Length
Length - return the length of a string
LimitOffsetPagination
Limit/offset based pagination
ListView
ListView for displaying multiple objects
LocalStoragenative and storage
Local filesystem storage
LoggingMiddlewaremiddleware or standard
Django-style request logging middleware with colored output
LoggingSettings
Logging configuration fragment.
LoginRequiredConfigmiddleware or standard
Configuration for LoginRequiredMiddleware.
LoginRequiredMiddlewaremiddleware or standard
Login required middleware.
LowPriorityEnvSource
Low-priority environment variable configuration source
Lower
Lower - convert string to lowercase
M2MChangeEventnative and signals
M2M changed signal - sent when many-to-many relationships change
MediaSettings
Media files configuration fragment.
MediaTypeopenapi
Represents a media type (MIME type)
MetadataOptions
Options for configuring metadata
MetadataResponse
Complete metadata response
Methodnative
The Request Method (VERB)
MiddlewareChainnative and core
Middleware chain - composes multiple middleware into a single handler.
MiddlewareConfig
Middleware configuration
Migration
A database migration
MigrationAutodetector
Migration autodetector
MigrationPlan
Migration execution plan
MigrationRecorder
Migration recorder (in-memory only, for backward compatibility)
Mod
Mod - modulo operation
ModelForm
A form that is automatically generated from a Model
ModelState
Model state for migration detection
ModelViewSet
ModelViewSet - combines all CRUD mixins, backed by a real ModelViewSetHandler for database-backed CRUD.
MultiPartParserapi-only or compressed-parsers or full or rest or standard
MultiPart parser for multipart/form-data content type (file uploads)
MultiTermSearchapi-only or api or full or rest or standard
Combines multiple search terms across multiple fields
NTile
NTILE window function
NamespaceVersioning
Namespace versioning (URL namespace-based)
Now
Now - current timestamp
NthValue
NTH_VALUE window function
NullIf
NullIf - return NULL if two expressions are equal
ObjectBuilderopenapi
Builder for Object with chainable configuration methods to create a new Object.
ObjectPermission
Object permission with Permission trait support
ObjectPermissionManager
Object permission manager
OpenApiRouteropenapi-router
Router wrapper that adds OpenAPI documentation endpoints
OpenApiSchemaopenapi
Root object of the OpenAPI document.
Operationopenapi
Implements OpenAPI Operation Object object.
OptionalSessionValuemiddleware and sessions
Optional typed session-value extractor.
OriginGuardMiddlewaremiddleware or standard
Middleware that validates the Origin or Referer header on state-changing requests as a CSRF protection layer.
OuterRef
OuterRef - reference to a field in the outer query (for subqueries)
PageNumberPagination
Page number based pagination
PagesAuthenticatorwebsockets-pages
Authenticator that integrates with reinhardt-pages’ Cookie/session authentication
PaginatedResponse
Paginated response wrapper
ParamContextclient-router
Context for parameter extraction.
Parameteropenapi
Implements OpenAPI Parameter Object for Operation.
ParserMediaTypeapi-only or compressed-parsers or full or rest or standard
Media type representation
Pathdi or minimal or standard
Extract typed values from URL path parameters.
PathItemopenapi
Implements OpenAPI Path Item Object what describes Operations available on a single path.
PathMatchernative
Path matcher - uses composition to match paths
PathParamopenapi
Marker type for Path parameter metadata
PathPatternnative
Path pattern for URL matching Similar to Django’s URL patterns but using composition
PersistentRemoteUserMiddlewaremiddleware and sessions
Persistent remote user authentication middleware.
PhoneNumberValidatornative and core
Phone number validator for international phone numbers
PoolConfig
Represents a pool config.
Power
Power - raise to a power
ProjectState
Project state for migration detection
Querydi or minimal or standard
Extract query parameters from the URL
QueryParamopenapi
Marker type for Query parameter metadata
QueryParameterVersioning
Query parameter versioning
QuerySet
Represents a query set.
Rank
RANK window function
ReadOnlyModelViewSet
ReadOnlyModelViewSet - exposes only list and retrieve against a real ModelViewSetHandler.
RedisCachenative and cache and redis-backend
Redis cache backend with connection pooling
RedisSessionBackendmiddleware and session-redis
Session backend backed by Redis.
RedocUIopenapi
Redoc UI handler (alternative to Swagger UI)
RemoteUserMiddlewaremiddleware and sessions
Remote user authentication middleware.
RendererInfo
Renderer information for testing
Requestnative and core
HTTP Request representation
RequestBodyopenapi
Implements OpenAPI Request Body.
RequestContextdi
Context for per-request dependency injection resolution.
RequestScopedi
Per-request dependency cache that stores resolved instances for the duration of a request.
Responsenative and core
HTTP Response representation
Responseopenapi
Implements OpenAPI Response Object.
Room
A WebSocket room that manages multiple client connections
RoomManager
Manages multiple WebSocket rooms
Round
Round - round to specified decimal places
Routenative
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
Schedulernative and tasks
Task scheduler for managing periodic tasks
SchemaBuilderExtopenapi
Schema builder with serde attribute support
SchemaGeneratoropenapi
Schema generator for OpenAPI schemas
SchemaRegistrationopenapi
Compile-time schema registration metadata
SchemaRegistryopenapi
A registry for managing reusable OpenAPI schemas
ScopedRateThrottle
Scope-based rate throttle with per-scope rate limits.
SecurityMiddlewaremiddleware-security
Security middleware for HTTP security headers and redirects
SecuritySettings
Security-related configuration settings.
Serveropenapi
Represents target server object. It can be used to alter server connection for path operations.
ServerRouternative
Unified router with hierarchical routing support
Sessionnative and sessions
Django-style session object with dictionary-like interface
SessionMiddlewarenative and middleware and sessions
Session middleware
SessionSettings
Session configuration fragment.
SessionValuemiddleware and sessions
Required typed session-value extractor.
SessionValueNamedmiddleware and sessions
Typed session-value extractor parameterised by a SessionKey.
SettingsBuilder
Settings builder for layered configuration
Signalnative and signals
A signal that can dispatch events to connected receivers
SimpleMetadata
Simple metadata implementation
SingletonScopedi
Application-wide dependency cache that persists across all requests.
SoftDelete
Soft delete field that can be composed into structs
Sqrt
Sqrt - square root
StaticSettings
Static files configuration fragment.
StatusCodenative
An HTTP status code (status-code in RFC 9110 et al.).
Subquery
Subquery - represents a subquery expression
Substr
Substr - extract a substring
SwaggerUIopenapi
Swagger UI handler
Tagopenapi
Implements OpenAPI Tag Object.
TaskQueuenative and tasks
A task queue that delegates to a backend for task storage and retrieval.
TemplateConfigDeprecated
Template engine configuration
TestResponsenative and test
Test response wrapper
Timestamps
Common timestamp fields that can be composed into structs
TomlFileSource
TOML file configuration source
Transaction
Transaction manager
TransactionScope
Transaction scope guard with automatic rollback on drop
Trim
Trim - remove leading and trailing whitespace
URLPathVersioning
URL path versioning
UnifiedRouterclient-router
Unified router combining server and client routing capabilities.
UniqueConstraint
UNIQUE constraint (similar to Django’s UniqueConstraint)
UpdateUserData
User data for update
Upper
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
UrlValidatornative and core
URL validator
UserIdKeymiddleware and sessions
Default marker pointing at USER_ID_SESSION_KEY — the authenticated user’s primary key in every Reinhardt example app.
UserManager
User manager
UserRateThrottle
Rate throttle for authenticated user requests.
ValidationErrorsnative and core
Aggregates validation errors by field name.
VersioningMiddleware
Middleware for automatic API version detection
WebSocketConnection
WebSocket connection with activity tracking and timeout support
WebSocketRoute
A registered WebSocket route (path + optional name + metadata).
WebSocketRouter
WebSocket router: build-time registration + runtime lookup.
Window
Window specification
XFrameOptionsMiddlewaremiddleware or standard
X-Frame-Options middleware for clickjacking protection

Enums§

ActionType
Action type for ViewSet operations
AggregateFunc
Aggregate function types
AggregateValue
Result of an aggregation
AnnotationValue
Represents an annotation value that can be added to a QuerySet
AppErrornative and core
Errors that can occur when working with the application registry
DatabaseBackend
Defines possible database backend values.
DiErrordi
Errors that can occur during dependency injection resolution.
EnumTaggingopenapi
Enum tagging strategy
Errornative and core
The main error type for the Reinhardt framework.
ExtractComponent
Defines possible extract component values.
FieldError
Error type returned when field validation fails.
FieldType
Field type enumeration for metadata
FilterError
Errors that can occur during query filtering.
FilterOperator
Defines possible filter operator values.
FilterValue
Defines possible filter value values.
FormError
Error type returned when form-level validation fails.
FrameBoundary
Frame boundary
FrameType
Window frame type
GroupManagementError
Group management error
IsolationLevel
Transaction isolation levels
JwtErrorauth-jwt
JWT-specific errors with distinct variants for each failure mode.
M2MActionnative and signals
Actions that can occur on a many-to-many relationship.
MergeErrorclient-router
Error returned by ClientRouter::try_merge when two routers cannot be combined without silently shadowing a named route.
Message
WebSocket message types
MigrationError
Errors that can occur during migration operations.
NavigationTypeclient-router
The type of navigation that occurred.
NegotiationError
Error type for negotiation failures
Numberopenapi
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.
ParameterLocationopenapi
In definition of Parameter.
PoolError
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
QueryBuilderValue
Core value representation for SQL parameters.
QueryValue
Query value types
RefOropenapi
A Ref or some other type T.
RenameAllopenapi
Rename transformation strategy
Requiredopenapi
Value used to indicate whether parameter or property is required.
RoomError
Error types for room operations
RouteError
Routing errors for WebSocket routes
RouterFactorynative
Factory for creating server routers, supporting both sync and async creation.
SameSitenative and middleware and sessions
SameSite cookie attribute
Schemaopenapi
Is super type for OpenAPI Schema Object. Schema is reusable resource what can be referenced from path operations and other components using Ref.
SchemaErroropenapi
Errors that can occur during OpenAPI schema operations.
Scopedi
Defines the lifetime scope of a dependency.
SessionErrornative and sessions
Session backend errors
SqlType
Defines possible sql type values.
TrimType
Defines possible trim type values.
UpdateValue
Values that can be used in UPDATE statements
UserManagementError
User management error
ValidatorErrornative and core
Validation errors produced by validators.
VersioningError
Errors that can occur during API version determination.
WebSocketError
Errors that can occur during WebSocket operations.
XFrameOptionsmiddleware or standard
X-Frame-Options values

Constants§

USER_ID_SESSION_KEYmiddleware and sessions
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§

ApplyUpdate
Trait for applying partial updates from one struct to another.
AuthBackend
Unified authentication backend trait
AuthIdentity
Authentication identity trait - replacement for the deprecated User trait.
BaseContentNegotiation
Base content negotiator trait
BaseMetadata
Base trait for metadata providers
BaseUser
BaseUser trait - Django-style authentication
BaseVersioning
Base trait for API versioning strategies
Cachenative and cache
Base cache trait
ClientUrlResolver
Trait for resolving client-side (frontend) URLs by route name.
ComponentsExtopenapi
Extension trait for Components to provide convenient methods
Constraint
Base trait for all constraints
CookieNamedi or minimal or standard
Marker trait for cookie names.
CreateMixin
Create mixin - provides create() action
Deserializenative and core
A data structure that can be deserialized from any data format supported by Serde.
Deserializerapi-only or api or full or rest or standard
Deserializer trait for one-way deserialization
DestroyMixin
Destroy mixin - provides destroy() action
FieldOrderingExtapi-only or api or full or rest or standard
Extension trait to add ordering methods to Field
FilterBackend
A backend that applies query parameter filters to a SQL query string.
FromPathclient-router
Trait for extracting typed values from path parameters.
FullUser
FullUser trait - Django’s AbstractUser equivalent
GenericRelatable
Trait for models that can be targets of generic relations
Handlernative and core
Handler trait for processing requests.
HasCoreSettings
Trait for accessing the settings fragment from a composed settings type.
HasSettings
Generic accessor trait for settings fragments.
HttpErrornative and core
Application-defined error contract for HTTP response mapping.
Injectabledi
Injectable trait for dependencies.
InjectableKeydi
Marker trait for dependency provider keys.
IntoValue
Trait for converting Rust types to SQL values.
ListMixin
Mixin traits for ViewSet functionality These use composition instead of multiple inheritance List mixin - provides list() action
Middlewarenative and core
Middleware trait for request/response processing.
Model
Core trait for database models Uses composition instead of inheritance - models can implement multiple traits
ModelType
Trait for models that can be registered as content types
MultipleObjectMixin
Trait for views that work with multiple objects
ObjectPermissionChecker
Object permission checker trait
OpenApiSchemaExtopenapi
Extension trait for OpenApiSchema to provide convenient methods
OperationExtopenapi
Extension trait for Operation to provide convenient methods
Paginator
Trait for pagination implementations
ParameterExtopenapi
Extension trait for Parameter to provide convenient constructors
ParameterMetadataopenapi
Trait for types that can provide OpenAPI parameter metadata
Parserapi-only or compressed-parsers or full or rest or standard
Trait for request body parsers
PasswordHasher
Password hasher trait
PathItemExtopenapi
Extension trait for PathItem to provide constructor
Permission
Permission trait - defines permission checking interface
PermissionsMixin
PermissionsMixin trait - Django’s PermissionsMixin equivalent
RequestVersionExt
Extension trait to get API version from request
ResponsesExtopenapi
Extension trait for Responses to provide collection methods
RetrieveMixin
Retrieve mixin - provides retrieve() action
Routernative
Router trait - composes routes together
SchemaExtopenapi
Extension trait for Schema to provide convenient constructor methods
Serializenative and core
A data structure that can be serialized into any data format supported by Serde.
Serializerapi-only or api or full or rest or standard
Core serializer trait for converting between input and output representations
SessionAuthExtmiddleware and sessions
Login/logout helpers for SessionData.
SessionBackendnative and sessions
Session backend trait
SessionKeymiddleware and sessions
Marker trait identifying a session-storage key at the type level.
SettingsFragment
A rootable composable unit of configuration.
SingleFromPathclient-router
Trait for extracting a single value at a specific index from path parameters.
SingleObjectMixin
Trait for views that work with a single object
SoftDeletable
Trait for soft-deletable models Another composition trait instead of inheritance
Storagenative and storage
Trait for file storage backends
Tasknative and tasks
Core trait that all tasks must implement, providing identity and metadata.
TaskExecutornative and tasks
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
ToSchemaopenapi
Trait for types that can generate OpenAPI schemas
TransactionExecutor
Transaction executor trait for database-specific transaction handling
UpdateMixin
Update mixin - provides update() action
UrlResolvernative
Base trait for type-safe URL resolution.
Validatenative and core
Trait for struct-level validation.
Validatornative and core
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
WebSocketConsumer
WebSocket consumer trait
WebSocketUrlResolvernative
Trait for resolving WebSocket endpoint URLs by route name.
WindowFunction
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_routernative
Clear the registered router (useful for tests)
clear_websocket_router
Clears the process-wide WebSocket router (primarily for tests).
generate_openapi_schemaopenapi
Generate OpenAPI schema from global registry
get_list_or_404database and shortcuts
Get a list of objects from the database or return a 404 response if empty
get_object_or_404database and shortcuts
Get a single object from the database or return a 404 response
get_routernative
Get a reference to the globally registered router
get_websocket_router
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_changednative and signals
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_deletenative and signals
Post-delete signal - sent after a model instance is deleted
post_savenative and signals
Post-save signal - sent after a model instance is saved
pre_deletenative and signals
Pre-delete signal - sent before a model instance is deleted
pre_savenative and signals
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
Create a validated temporary redirect (HTTP 302) to the specified URL.
register_routernative
Register the application’s main router globally
register_router_arcnative
Register a router that is already wrapped in Arc.
register_websocket_router
Installs router as the process-wide WebSocket router.
render_htmlshortcuts
Render a simple HTML string and return an HTTP 200 response
render_jsonshortcuts
Render data as JSON and return an HTTP 200 response, or an error if serialization fails
render_textshortcuts
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_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§

AppResultnative and core
A specialized Result type for application operations.
Context
Context data for template rendering
DiResultdi
A specialized Result type for dependency injection operations.
FilterResult
A convenience type alias for filter operation results.
FormResult
Result type alias for form-level operations.
GroupManagementResult
Group management result
ParseErrorapi-only or compressed-parsers or full or rest or standard
Type alias for parser errors, using the framework’s Error type.
ParseResultapi-only or compressed-parsers or full or rest or standard
Type alias for parser results, using the framework’s Result type.
Resultnative and core
A convenient Result type alias using reinhardt_core::exception::Error as the error type.
RoomResult
A specialized Result type for room operations.
RouteResult
Routing result type
SchemaObjectopenapi
A complete schema object with metadata This is an alias to utoipa’s Schema for convenience
SchemaResultopenapi
Result type for OpenAPI schema operations.
UserManagementResult
User management result
ValidationResultnative and core
Result type for validation operations.
ViewResultnative and core
A convenient type alias for view/endpoint function return types.
WebSocketResult
A specialized Result type for WebSocket operations.

Attribute Macros§

adminnative and admin
Attribute macro for ModelAdmin configuration
api_viewnative
Decorator for function-based API views
app_config
Attribute macro for Django-style AppConfig definition with automatic derive
apply_updatenative
Attribute macro for applying partial updates to target structs
async_traitnative
deletenative
DELETE method decorator
dto
Attribute macro that absorbs the cfg_attr(native, ...) boilerplate for DTOs shared between the server (native cfg) and client (wasm) builds.
getnative
GET method decorator.
injectabledi
Register an injectable provider function.
injectable_keydi
Mark a type as a dependency provider key.
model
Attribute macro for Django-style model definition with automatic derive
patchnative
PATCH method decorator
postnative
POST method decorator
putnative
PUT method decorator
routes
Register URL patterns for automatic discovery by the framework
settingsnative and conf
Settings attribute macro for composable configuration.
user
Attribute macro for generating auth trait implementations.
viewsetnative
Generate URL resolver traits for a ViewSet function.

Derive Macros§

AppConfig
Derive macro for automatic AppConfig factory method generation
DeriveApplyUpdatenative
Derive macro for automatic ApplyUpdate trait implementation
Deserializenative and core
HttpError
Implements HTTP status and client-message mapping for application error enums.
Model
Derive macro for automatic Model implementation and migration registration
Schemaopenapi
Derive macro for automatic OpenAPI schema generation.
Serializenative and core
Validatenative and core
Derive macro for struct-level validation