refactor(types)!: use string-based scheme over enum-based approach#6765
Merged
refactor(types)!: use string-based scheme over enum-based approach#6765
Conversation
Member
Author
|
To avoid too many breaking changes to bindings, I don't want to remove the |
tisonkun
reviewed
Nov 9, 2025
e5296bd to
d560966
Compare
d560966 to
4c05595
Compare
92b6e8b to
2dae2b5
Compare
Member
|
Let's merge this PR after |
Member
|
Release failed anyways... Let's merge now. |
Xuanwo
reviewed
Nov 12, 2025
| @@ -34,63 +33,66 @@ use crate::Error; | |||
| pub enum Scheme { | |||
Member
There was a problem hiding this comment.
How about we change Scheme as a type alias to &'static str?
Member
Author
There was a problem hiding this comment.
Actually, some bindings still rely on the Scheme enum (like java bindings).
The current PR only removes the usage of the Scheme enum from the core.
Member
There was a problem hiding this comment.
Actually, some bindings still rely on the
Schemeenum (like java bindings). The current PR only removes the usage of theSchemeenum from the core.
Got it, we can finally remove them all in the future.
Xuanwo
approved these changes
Nov 12, 2025
Contributor
Member
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.
Which issue does this PR close?
Part of #6755
Rationale for this change
After merging #6764, the
Schemeenum is no longer very useful, and is only used for theOperator::via_iterandOperator::via_mapAPIs. Thevia_mapAPI has been replaced byvia_iterand has been deprecated for a while, while thevia_iterAPI is used more in test scenarios and bindings.What changes are included in this PR?
Schemeenum usage from coreAsRef<str>forSchemeenum to avoid many breaking changes of bindings-instead of_as the concatenation operator for multiple fields in the string-based scheme.Are there any user-facing changes?
Operator::via_iter(scheme: Scheme, iter: impl IntoIterator<Item = (String, String)>)=>Operator::via_iter(scheme: impl AsRef<str>, iter: impl IntoIterator<Item = (String, String)>)Operator::via_map(scheme: Scheme, map: HashMap<String, String>)=>Operator::via_map(scheme: impl AsRef<str>, map: HashMap<String, String>)OperatorInfo::scheme(&self) -> Scheme=>Operator::scheme(&self) -> &'static str