pub struct ActionOutcome {
pub input: DataId,
pub goal: GoalId,
pub status: GoalStatus,
pub metadata: Metadata,
pub payload: Payload,
}Expand description
One status update, as a client or server sees it.
Fields§
§input: DataIdThe input it arrived on.
goal: GoalIdThe goal it concerns.
status: GoalStatusThe status it reports.
metadata: MetadataIts metadata.
payload: PayloadThe payload — a result for a terminal status, feedback otherwise.
Implementations§
Source§impl ActionOutcome
impl ActionOutcome
Sourcepub fn from_event(event: Event) -> Result<Self, Box<Event>>
pub fn from_event(event: Event) -> Result<Self, Box<Event>>
Reads a status update out of an event, if it is one.
An input with a goal_id but no goal_status is the goal itself
(what a server receives), not an update; it is returned unchanged so a
server can handle it with ActionOutcome::goal_of.
Sourcepub fn goal_of(event: &Event) -> Option<GoalId>
pub fn goal_of(event: &Event) -> Option<GoalId>
The goal id of an event that carries one, whether or not it is a status update.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether this update ends the goal.
Sourcepub fn is_feedback(&self) -> bool
pub fn is_feedback(&self) -> bool
Whether this update is feedback rather than an outcome.
Sourcepub fn view<T: FromPayload>(&self) -> Result<T>
pub fn view<T: FromPayload>(&self) -> Result<T>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ActionOutcome
impl !RefUnwindSafe for ActionOutcome
impl !UnwindSafe for ActionOutcome
impl Send for ActionOutcome
impl Sync for ActionOutcome
impl Unpin for ActionOutcome
impl UnsafeUnpin for ActionOutcome
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