Skip to content

[Command] Allow enum and newtype #15

@Freyskeyd

Description

@Freyskeyd

Command can already be use with enum and newtype but the Command derive only support struct.

#[derive(Debug)]
struct AppendItem(i64);

impl Command for AppendItem {
    type Event = ItemAppended;

    type Executor = ExampleAggregate;

    type ExecutorRegistry = AggregateInstanceRegistry<ExampleAggregate>;

    fn identifier(&self) -> String {
        "example_aggregate".to_string()
    }
}

It could be possible to have an enum which can be dispatch to the CommandExecutor.

Some questions need to be resolved first:

  • How to deal with command's identity ?
  • Is it really necessary ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions