Skip to content

Refined Context consume strategy and add UserData and is_consumed to Error structure#97

Merged
ehwan merged 2 commits into
mainfrom
accept_reference
Jul 11, 2026
Merged

Refined Context consume strategy and add UserData and is_consumed to Error structure#97
ehwan merged 2 commits into
mainfrom
accept_reference

Conversation

@ehwan

@ehwan ehwan commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Context is now consumed, so the context can't be reused after consumed for some feed failure:

  • for NoAction, since the stack was not modified, the Context still can be reused after failure
  • for ReduceActionError, since the stack was modified, the Context can't be reused after the error.
  • If the user tried to feed on consumed Context, it will immediately return the error, and can_feed and it's variant will always return false on consumed Context.
  • accept() now takes &mut self instead of self. When accept succeeded, the context will be switched into consumed state.

@ehwan ehwan self-assigned this Jul 11, 2026
@ehwan ehwan merged commit 96520e3 into main Jul 11, 2026
1 check passed
@ehwan ehwan deleted the accept_reference branch July 11, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant