Expand description
§Reinhardt REST
Unified REST API framework for Reinhardt.
This crate provides a complete REST API framework by integrating:
- Serializers: Data serialization and validation (from reinhardt-serializers)
- Parsers: Request body parsing (from reinhardt-parsers)
- Authentication: JWT, Token, Session, Basic auth (from reinhardt-auth)
- Routers: Automatic URL routing for ViewSets (from reinhardt-routers)
- Browsable API: HTML interface for API exploration (from reinhardt-browsable-api)
§Features
- default: Enables serializers and parsers
- serializers: Data serialization and validation components
- parsers: Request body parsing (JSON, Form, Multipart)
§Example
use reinhardt_rest::parsers::JSONParser;
// Create a JSON parser
let parser = JSONParser::new();For router integration, see reinhardt_urls::routers crate.
§Testing
This crate contains unit tests for the integrated modules.
Integration tests are located in tests/integration/.
Re-exports§
pub use authentication::AuthResult;pub use response::ApiResponse;pub use response::IntoApiResponse;pub use response::ResponseBuilder;pub use crate::serializers::ModelSerializer;pub use crate::serializers::UniqueTogetherValidator;pub use crate::serializers::UniqueValidator;pub use crate::browsable_api::*;
Modules§
- authentication
- REST API authentication
- browsable_
api - Browsable API for Reinhardt
- filters
- Type-safe filtering backends for Reinhardt framework
- metadata
- Reinhardt Metadata
- negotiation
- Content negotiation for Reinhardt
- pagination
- Reinhardt Pagination
- parsers
- Reinhardt Parsers
- response
- REST API response types
- serializers
- Reinhardt Serializers
- throttling
- Rate limiting for Reinhardt framework
- versioning
- Reinhardt Versioning
Macros§
- versioned_
handler - Macro for creating versioned handlers easily
- versioned_
url - Macro for easy URL building
Structs§
- Allow
Any - AllowAny - grants permission to all requests
- Anonymous
User - Anonymous user - represents a non-authenticated visitor
- Content
Negotiator - Content Negotiation - Re-exports from reinhardt-negotiation Content negotiator for selecting appropriate renderer
- File
Upload Parser - Raw file upload parser
- Form
Parser - Form parser for application/x-www-form-urlencoded content type
- IsAdmin
User - IsAdminUser - requires the user to be an admin
- IsAuthenticated
- IsAuthenticated - requires the user to be authenticated
- IsAuthenticated
OrRead Only - IsAuthenticatedOrReadOnly - authenticated for writes, allow reads
- JSON
Parser - JSON parser for application/json content type
- Json
Serializer - JSON serializer implementation
- Media
Type - Media type representation
- Multi
Part Parser - MultiPart parser for multipart/form-data content type (file uploads)
- Paginated
Response - Paginated response wrapper
- Simple
User - Simple user implementation with basic fields
Enums§
- Serializer
Error - Errors that can occur during serialization
Traits§
- Auth
Backend - Authentication backend trait
- Deserializer
- Deserializer trait for one-way deserialization
- Parser
- Trait for request body parsers
- Permission
- Permission trait - defines permission checking interface
- Serializer
- Core serializer trait for converting between input and output representations
- User
- User trait - Core authentication trait