Skip to main content

Crate entity_core

Crate entity_core 

Source
Expand description

Core traits and types for entity-derive.

This crate provides the foundational traits and types used by entity-derive generated code. It can also be used standalone for manual implementations.

§Overview

  • Repository — Base trait for all generated repository traits
  • Pagination — Common pagination parameters
  • prelude — Convenient re-exports

§Usage

Most users should use entity-derive directly, which re-exports this crate. For manual implementations:

use entity_core::prelude::*;

#[async_trait]
impl UserRepository for MyPool {
    type Error = MyError;
    type Pool = PgPool;
    // ...
}

Modules§

outbox
Transactional-outbox drainer runtime.
policy
Policy/authorization types for entity-derive.
prelude
Convenient re-exports for common usage.
schema
Runtime schema assertion for derived entities.
serde_helpers
Serde helpers for generated DTOs.
stream
Streaming types for real-time entity updates.
transaction
Transaction support for entity-derive.

Structs§

ConstraintError
A database constraint violation resolved to entity metadata.
Pagination
Pagination parameters for list operations.
TransitionError
A state-machine transition was attempted from a status it is not declared for.

Enums§

CommandKind
Kind of business command.
ConstraintKind
Kind of database constraint that was violated.
EventKind
Kind of lifecycle event.
SortDirection
Sort direction for ordered queries.

Traits§

EntityCommand
Base trait for entity commands.
EntityEvent
Base trait for entity lifecycle events.
Repository
Base repository trait.

Functions§

const_str_eq
Compare two strings in const context.

Attribute Macros§

async_trait
Re-export async_trait for generated code.