Shared domain entities, events, and utilities for the blog platform. This crate contains platform-agnostic types used by both the server (blog-server) and the frontend (blog-ui).
Domain model types for the blogging platform:
- Author / AuthorContainer / AuthorsContainer - Author profiles and collections
- Post / PostContainer / PostsContainer - Blog posts and collections
- Comment / CommentsContainer - Post comments
- Tag / TagContainer - Post tags
- Login - Authentication request types
- Chat - Chat message types
- CommonPost / CommonComment / CommonMinimalAuthor / CommonSecondaryAuthor - Shared trait abstractions
- TotalOffsetLimitContainer - Paginated response wrapper
Async event definitions for the event bus:
- NewPostPublished - Fired when a new post is published
- SubscriptionStateChanged - Fired when a subscription state changes
Utilities for manipulating author slugs with a ^ separator (clean/extend operations).
Pagination logic with PageProcessor trait and DefaultPageProcessor<LIMIT> implementation for offset-based pagination.
validator- Enables validator derive macros for request validation
serde- Serialization/deserialization with derive supportvalidator(optional) - Struct validation
Add to your Cargo.toml:
[dependencies]
blog-generic = { path = "../blog-generic" }With validation support:
[dependencies]
blog-generic = { path = "../blog-generic", features = ["validator"] }