Skip to main content

EntityFactory

Trait EntityFactory 

Source
pub trait EntityFactory<E, DTO>: Send + Sync {
    // Required method
    fn build(&self, dto: DTO) -> UseCaseResult<E>;
}
Expand description

Builds an entity from a Create DTO.

Generated code emits one impl per entity; custom code can replace it by wrapping the use case with a UseCaseHooks implementation.

Required Methods§

Source

fn build(&self, dto: DTO) -> UseCaseResult<E>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§