Replies: 2 comments 1 reply
-
I really like the |
Beta Was this translation helpful? Give feedback.
0 replies
-
+1 from me! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
As we're getting close to 1.0.0, we want to finalise API and breaking changes.
One set will be about concrete errors, and another - consistent and nice builders.
This Discussion is about the builders.
Possibilites
With the recent introduction of IntoFuture trait,
we got a new way of adding seamless builders.
Though after spending some time with them, I'm worried that despite being sleek API-wise, abusing that trait for builders might resemble abusing
Deref
for newtypes.Propositions
We would attach builders to a given context, to make calling those easy:
non-hot-path / nouns
That means that:
build_noun
-> options -> verb as in non-builder method.into_future
hotpaths / verbs
With
into_future
, theawait
acts as a finalizer (send
) of the builder.That makes working with verbs/hotpaths seamless - no need to create a builder,
no need to call finalizer.
This is a less magical, approach.
It does seem verbose, though.
*.with_options
was used, as it fit better with verb-related builders and hotpaths.Open questions
We lean towards not leveraging
IntoFuture
for noun/not hotpaths, and using it for hotpaths, but we would love to hear your feedback. We want to make this change only once, and provide as nice as possible API for you all.What do you think about the above?
Do you think that even for hotpaths, leveraging
IntoFuture
is abusing the trait?Or the other way around - you think we should use it everywhere?
Tagging a few users/contributors for visibility, but everybody's opinion is valuable here!
@segfaultdoc @autodidaddict @thomastaylor312 @stevelr @paulgb @caspervonb
Beta Was this translation helpful? Give feedback.
All reactions