feat(nfs3_client): add is_connection_reusable method to error types#162
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight API to nfs3_client error types so callers can decide whether an underlying connection can be safely reused after an error, without needing to match on individual error variants.
Changes:
- Documented connection state semantics for
RpcClient::callandRpcError. - Added
is_connection_reusable()inherent methods toRpcError,PortmapError,MountError, andConnectError. - Updated the
clippy::similar_namessuppression onRpcClient::callto use#[expect(..., reason = ...)].
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/nfs3_client/src/rpc.rs | Documents how callers should decide whether to reuse a connection after call() errors; updates clippy suppression style. |
| crates/nfs3_client/src/error/rpc.rs | Adds RpcError::is_connection_reusable() and documents connection-state considerations. |
| crates/nfs3_client/src/error/portmap.rs | Adds PortmapError::is_connection_reusable() delegating to RpcError when applicable. |
| crates/nfs3_client/src/error/mount.rs | Adds MountError::is_connection_reusable() delegating to RpcError when applicable. |
| crates/nfs3_client/src/error/connect.rs | Adds ConnectError::is_connection_reusable() delegating to nested errors. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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.
Adds an
is_connection_reusablemethod to all error types in nfs3_client, letting callers decide whether a connection can be kept after an error without inspecting individual variants