refactor!: replace Deref with accessor methods on ServiceFailure and RemoteError - #11
Merged
Merged
Conversation
…ceFailure and RemoteError BREAKING CHANGE: ServiceFailure and RemoteError no longer implement Deref/DerefMut to their inner state structs. Field access like `sf.inner`, `sf.frames`, `sf.trace` must be replaced with accessor methods: `sf.inner()`, `sf.frames()`, `sf.trace()`. Mutable access uses `sf.inner_mut()`, `sf.frames_mut()`, `sf.trace_mut()`. RemoteErrorParts has been removed; RemoteError::from_parts() now accepts RemoteErrorInner directly. RemoteError fields are accessed via methods: `r.category()`, `r.type_id()`, `r.frames()`, `r.trace()`, `r.outer_code()`, `r.outer_message()`. ServiceFailureInner visibility is now pub(crate). RemoteErrorInner fields are now pub(crate). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ae2rs
added a commit
that referenced
this pull request
May 26, 2026
…RemoteError (#11) refactor!: replace Deref<Target=Inner> with accessor methods on ServiceFailure and RemoteError BREAKING CHANGE: ServiceFailure and RemoteError no longer implement Deref/DerefMut to their inner state structs. Field access like `sf.inner`, `sf.frames`, `sf.trace` must be replaced with accessor methods: `sf.inner()`, `sf.frames()`, `sf.trace()`. Mutable access uses `sf.inner_mut()`, `sf.frames_mut()`, `sf.trace_mut()`. RemoteErrorParts has been removed; RemoteError::from_parts() now accepts RemoteErrorInner directly. RemoteError fields are accessed via methods: `r.category()`, `r.type_id()`, `r.frames()`, `r.trace()`, `r.outer_code()`, `r.outer_message()`. ServiceFailureInner visibility is now pub(crate). RemoteErrorInner fields are now pub(crate). Co-authored-by: ae2rs <ae2rs@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deref/DerefMutimpls fromServiceFailure<E>andRemoteError, replacing implicit field access with explicit accessor methodsRemoteErrorParts—RemoteError::from_parts()now acceptsRemoteErrorInnerdirectly (the two structs were identical)ServiceFailureInneris nowpub(crate),RemoteErrorInnerfields are nowpub(crate)New accessor methods
ServiceFailure<E>:inner(),inner_mut(),frames(),frames_mut(),trace(),trace_mut()RemoteError:category(),type_id(),frames(),trace(),outer_code(),outer_message()Migration guide
Test plan
trace_chain,basic) compile and updatedcargo fmt --allclean🤖 Generated with Claude Code