pub struct EventUpcaster {
pub event_type: &'static str,
pub from_version: u64,
pub to_version: u64,
pub transform: fn(event: &EventRecord) -> Result<Vec<u8>, UpcastError>,
}Expand description
A stateless, pure transformation that converts an event payload from one version to another.
Upcasters are plain structs with function pointers — no traits, no boxing, no dynamic dispatch.
They are returned as static slices (&'static [EventUpcaster]) for zero allocation overhead.
Fields§
§event_type: &'static str§from_version: u64§to_version: u64§transform: fn(event: &EventRecord) -> Result<Vec<u8>, UpcastError>Auto Trait Implementations§
impl Freeze for EventUpcaster
impl RefUnwindSafe for EventUpcaster
impl Send for EventUpcaster
impl Sync for EventUpcaster
impl Unpin for EventUpcaster
impl UnsafeUnpin for EventUpcaster
impl UnwindSafe for EventUpcaster
Blanket Implementations§
Source§impl<T> AggregateBuilder for T
impl<T> AggregateBuilder for T
fn aggregate<A: Aggregate>(self) -> AggregateRepository<Self, A>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Queueable for T
impl<T> Queueable for T
Source§fn queued(self) -> QueuedRepository<Self, InMemoryAsyncLockManager>
fn queued(self) -> QueuedRepository<Self, InMemoryAsyncLockManager>
Wrap with the default async lock manager. Pair with
.aggregate::<T>() for per-aggregate serialization over the async
repository surface.Source§fn queued_with<L: AsyncLockManager>(
self,
lock_manager: L,
) -> QueuedRepository<Self, L>
fn queued_with<L: AsyncLockManager>( self, lock_manager: L, ) -> QueuedRepository<Self, L>
Wrap with a custom async lock manager.