You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is this important if the function takes ownership of the value?
The inner API from_node_info needs to consume the value. I think it is idiomatic of the builder pattern to consume values and generate new values.
It would be dropped in the error, no?
Yes, but this was in the previous case when the builder was empty. Perhaps, the correct thing to do here(and other builder APIs) is to return to the previous builder state in the error value.
I think we should probably have a thing that is Result<FinishedT, Result<Self, Error>> or introduce a custom type (so that we don't have issues with ? composition) Finishable<FinishedT, UnfinishedT, Error> that represents a continuable computation.
We can then better model all our builders where we can model the tri-state finished/continue/break with error.
The text was updated successfully, but these errors were encountered:
The inner API
from_node_info
needs to consume the value. I think it is idiomatic of the builder pattern to consume values and generate new values.Yes, but this was in the previous case when the builder was empty. Perhaps, the correct thing to do here(and other builder APIs) is to return to the previous builder state in the error value.
Originally posted by @sanket1729 in #936 (comment)
I think we should probably have a thing that is Result<FinishedT, Result<Self, Error>> or introduce a custom type (so that we don't have issues with ? composition) Finishable<FinishedT, UnfinishedT, Error> that represents a continuable computation.
We can then better model all our builders where we can model the tri-state finished/continue/break with error.
The text was updated successfully, but these errors were encountered: