forked from protocolbuffers/protobuf-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proto: add MarshalState, UnmarshalState
Add functions to the proto package which plumb through the fast-path state. As a sample use case: A followup CL adds an Initialized field to protoiface.UnmarshalOutput, permitting the unmarshaller to report back when it can confirm that a message is fully initialized. We want to preserve that information when an unmarshal operation threads through the proto package (such as when unmarshaling extensions). To allow these functions to be added as methods of MarshalOptions and UnmarshalOptions rather than top-level functions, separate the options from the input structs. Also update options passed to fast-path methods to set AllowPartial and Merge to reflect the expected behavior of those methods. (Always allow partial, never merge.) Change-Id: I482477b0c9340793be533e75a86d0bb88708716a Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/215877 Reviewed-by: Joe Tsai <[email protected]>
- Loading branch information
Showing
8 changed files
with
90 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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