pub struct FoldDispatchAdapter<K: FoldKind> { /* private fields */ }Expand description
Adapter that lifts a typed Fold<K> into the non-generic
FoldDispatch trait. Holds an Arc<Fold<K>> so multiple
dispatchers (and the application code that queries the fold
directly) share the same instance.
Implementations§
Source§impl<K: FoldKind> FoldDispatchAdapter<K>
impl<K: FoldKind> FoldDispatchAdapter<K>
Trait Implementations§
Source§impl<K: FoldKind> FoldDispatch for FoldDispatchAdapter<K>
impl<K: FoldKind> FoldDispatch for FoldDispatchAdapter<K>
Source§fn kind_id(&self) -> u16
fn kind_id(&self) -> u16
KIND_ID of the wrapped fold. Returned by the adapter
so the registry can cross-check on register and the
dispatch path can reject envelopes whose decoded kind
disagrees with the routing key.Source§fn stats(&self) -> FoldStats
fn stats(&self) -> FoldStats
Type-erased
Fold::stats. The operator surface
aggregates these across the registry via
FoldRegistry::stats so a single net fold list call
returns one row per registered fold.Source§fn dispatch(
&self,
bytes: &[u8],
publisher: &EntityId,
) -> Result<ApplyOutcome, WireError>
fn dispatch( &self, bytes: &[u8], publisher: &EntityId, ) -> Result<ApplyOutcome, WireError>
Decode + verify + apply. Returns the apply outcome so
metrics / audit can attribute the result; surfaces
WireError for codec / verification failures and wraps
any apply-side FoldError via WireError::Apply.Auto Trait Implementations§
impl<K> Freeze for FoldDispatchAdapter<K>
impl<K> !RefUnwindSafe for FoldDispatchAdapter<K>
impl<K> Send for FoldDispatchAdapter<K>
impl<K> Sync for FoldDispatchAdapter<K>
impl<K> Unpin for FoldDispatchAdapter<K>
impl<K> UnsafeUnpin for FoldDispatchAdapter<K>
impl<K> !UnwindSafe for FoldDispatchAdapter<K>
Blanket Implementations§
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