aboutsummaryrefslogtreecommitdiff
path: root/binary/decoder.go
diff options
context:
space:
mode:
authorBen Clayton <bclayton@google.com>2015-06-30 11:53:39 +0100
committerBen Clayton <bclayton@google.com>2015-06-30 14:11:49 +0000
commit0ba10ed0f97b6a6d96c596a1ea7031e8dd4cec11 (patch)
tree900ecf94fb997c589d37e8f24d80e4d249ca91fe /binary/decoder.go
parentc331ed17df6e3156c6a3ed126360e4cb8db3ba5c (diff)
downloadgpu-0ba10ed0f97b6a6d96c596a1ea7031e8dd4cec11.tar.gz
Add POD support to Encoder and Decoder methods.
This solves issues where we need to support POD types as well as Objects in RPC fields. Change-Id: I787788a14c07bc19c0afc2bc479a63541b349c22
Diffstat (limited to 'binary/decoder.go')
-rw-r--r--binary/decoder.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/binary/decoder.go b/binary/decoder.go
index 8fa450f17..7e305c5f8 100644
--- a/binary/decoder.go
+++ b/binary/decoder.go
@@ -26,16 +26,18 @@ type Decoder interface {
// SkipValue must skip the same data that a call to Value would read.
// The value may be a typed nil.
SkipValue(Object) error
- // Variant decodes and returns an Object from the stream. The Class in the
- // stream must have been previously registered with binary.registry.Add.
- Variant() (Object, error)
+ // Variant decodes and returns a POD value or Object from the stream.
+ // If the value in the stream is an Object, the Class in the stream must have
+ // been previously registered with binary.registry.Add.
+ Variant() (interface{}, error)
// SkipVariant must skip the same data that a call to Variant would read.
SkipVariant() (ID, error)
- // Object decodes and returns an Object from the stream. Object instances
- // that were encoded multiple times may be decoded and returned as a shared,
- // single instance. The Class in the stream must have been previously
- // registered with binary.registry.Add.
- Object() (Object, error)
+ // Object decodes and returns a POD value or Object from the stream.
+ // Values that were encoded multiple times may be decoded and returned as a
+ // shared, single instance.
+ // If the value in the stream is an Object, the Class in the stream must have
+ // been previously registered with binary.registry.Add.
+ Object() (interface{}, error)
// SkipObject must skip the same data that a call to Object would read.
SkipObject() (ID, error)
// Lookup the class that would be used to encode an id in this encoder.