Package io.github.alexandrepiveteau.echo.projections

Types

Link copied to clipboard
interface ChangeScope<in T>

A ChangeScope defines operations which may be undertaken when performing the TwoWayProjection.forward moves.

Link copied to clipboard
class OneWayMutableProjection<M, T>(    projection: OneWayProjection<M, T>,     eventSerializer: KSerializer<T>,     format: BinaryFormat) : MutableProjection<M>

An implementation of a MutableProjection which wraps a TwoWayProjection with some dedicated serializers. This lets consumers of MutableProjection offer a higher-level API which works on generic types, rather than sequences of bytes.

Link copied to clipboard
fun interface OneWayProjection<M, in T>

A OneWayProjection applies a sequence of events of type T to a model of type M. This is the simplest projection possible, since it only applies operations in single direction, in a commutative fashion.

Link copied to clipboard
class TwoWayMutableProjection<M, T, C>(    projection: TwoWayProjection<M, T, C>,     changeSerializer: KSerializer<C>,     eventSerializer: KSerializer<T>,     format: BinaryFormat) : MutableProjection<M>

An implementation of a MutableProjection which wraps a TwoWayProjection with some dedicated serializers. This lets consumers of MutableProjection offer a higher-level API which works on generic types, rather than sequences of bytes.

Link copied to clipboard
interface TwoWayProjection<M, in T, C>

A TwoWayProjection applies a sequence of events of type T to a model of type M. This is a more advanced projection than OneWayProjection, because it allows sites to define a custom change type C which will contain meta-data to undo the application of an event. Therefore, it applies operations in multiple directions.