pub struct EffectResult {
pub event: PipelineEvent,
pub additional_events: Vec<PipelineEvent>,
pub ui_events: Vec<UIEvent>,
}Expand description
Result of executing an effect.
Contains both the PipelineEvent (for reducer) and optional UIEvents (for display). This separation keeps UI concerns out of the reducer while allowing handlers to emit rich feedback during execution.
§Multiple Events
Some effects produce multiple reducer events. For example, agent invocation may produce:
InvocationSucceeded- the primary eventSessionEstablished- additional event when session ID is extracted
The additional_events field holds events that should be processed after
the primary event. The reducer loop processes all events in order.
Fields§
§event: PipelineEventPrimary event for reducer (affects state).
additional_events: Vec<PipelineEvent>Additional events to process after the primary event.
Used for cases where an effect produces multiple events, such as agent invocation followed by session establishment. Each event is processed by the reducer in order.
ui_events: Vec<UIEvent>UI events for display (do not affect state).
Implementations§
Source§impl EffectResult
impl EffectResult
Sourcepub fn event(event: PipelineEvent) -> Self
pub fn event(event: PipelineEvent) -> Self
Create result with just a pipeline event (no UI events).
Sourcepub fn with_ui(event: PipelineEvent, ui_events: Vec<UIEvent>) -> Self
pub fn with_ui(event: PipelineEvent, ui_events: Vec<UIEvent>) -> Self
Create result with pipeline event and UI events.
Sourcepub fn with_additional_event(self, event: PipelineEvent) -> Self
pub fn with_additional_event(self, event: PipelineEvent) -> Self
Add an additional event to process after the primary event.
Used for emitting separate events like SessionEstablished after agent invocation completes. Each additional event is processed by the reducer in order.
Sourcepub fn with_ui_event(self, ui_event: UIEvent) -> Self
pub fn with_ui_event(self, ui_event: UIEvent) -> Self
Add a UI event to the result.
Trait Implementations§
Source§impl Clone for EffectResult
impl Clone for EffectResult
Source§fn clone(&self) -> EffectResult
fn clone(&self) -> EffectResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EffectResult
impl RefUnwindSafe for EffectResult
impl Send for EffectResult
impl Sync for EffectResult
impl Unpin for EffectResult
impl UnwindSafe for EffectResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more