Expand description

Effects that are lazily performed as a result of performing a command of an entity. Effects can be chained with other effects and are guaranteed to be applied (run) before the next command for an entity id is processed.

Convience methods are providing for commonly chained operations, and take the form of and_then and then as the prefix. By Rust convention, and_then provides the result of the previous operation and expects a result provided given some closure. Also by convention, then is applied only when the previous operation completed successfully.

In the case where there is no convenience method, a generalized and operation can be used to chain any effect found here, or a customized effect.

Structs

Enums

  • Errors that can occur when applying effects.

Traits

  • The trait that effect types implement.
  • Combinators for use with effects.

Functions

  • An effect to persist an event upon having successfully handed it off to be persisted. The event will be flagged to represent the deletion of an entity instance.
  • An effect to persist an event.
  • An effect to reply an envelope if the previous effect completed successfully. Note that if state from having persisted an event via a prior effect is required, then use a then effect instead.
  • A side effect to run a function asynchronously. The associated behavior is available so that communication channels, for example, can be accessed by the side-effect. Additionally, the latest state given any previous effect having persisted an event, or else the state at the outset of the effects being applied, is also available.
  • An unhandled command producing no effect

Type Definitions