Serializer/deserializer support for fundamental protobuf types.
Serializer/deserializer support for fundamental protobuf types.
(cis->Double is)
Deserialize a 'Double' type
Deserialize a 'Double' type
(cis->embedded f is)
Deserialize an embedded type, where f is an (fn) that can deserialize the embedded message
Deserialize an embedded type, where **f** is an (fn) that can deserialize the embedded message
(cis->Fixed32 is)
Deserialize a 'Fixed32' type
Deserialize a 'Fixed32' type
(cis->Fixed64 is)
Deserialize a 'Fixed64' type
Deserialize a 'Fixed64' type
(cis->Float is)
Deserialize a 'Float' type
Deserialize a 'Float' type
(cis->Int32 is)
Deserialize a 'Int32' type
Deserialize a 'Int32' type
(cis->Int64 is)
Deserialize a 'Int64' type
Deserialize a 'Int64' type
(cis->map f is)
Deserialize a wire format map-type to user format [key val]
Deserialize a wire format map-type to user format [key val]
(cis->packablerepeated tag f is)
Deserialize a repeated type which may optionally support packed format. The field type will indicate unpacked (0) vs packed (2).
Deserialize a repeated type which may optionally support [packed format](https://developers.google.com/protocol-buffers/docs/encoding#packed). The field type will indicate unpacked (0) vs packed (2).
(cis->packedrepeated f is)
Deserialize a 'packed' repeated type (see cis->packablerepeated
)
Deserialize a 'packed' repeated type (see [[cis->packablerepeated]])
(cis->repeated f is)
Deserialize an 'unpacked' repeated type (see cis->packablerepeated
)
Deserialize an 'unpacked' repeated type (see [[cis->packablerepeated]])
(cis->SFixed32 is)
Deserialize a 'SFixed32' type
Deserialize a 'SFixed32' type
(cis->SFixed64 is)
Deserialize a 'SFixed64' type
Deserialize a 'SFixed64' type
(cis->SInt32 is)
Deserialize a 'SInt32' type
Deserialize a 'SInt32' type
(cis->SInt64 is)
Deserialize a 'SInt64' type
Deserialize a 'SInt64' type
(cis->String is)
Deserialize a 'String' type
Deserialize a 'String' type
(cis->UInt32 is)
Deserialize a 'UInt32' type
Deserialize a 'UInt32' type
(cis->UInt64 is)
Deserialize a 'UInt64' type
Deserialize a 'UInt64' type
(cis->undefined tag is)
Deserialize an unknown type, retaining its tag/type
Deserialize an unknown type, retaining its tag/type
(size-Bool tag value)
(size-Bool tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Bool' type
Compute length of serialized 'Bool' type
(size-Bytes tag value)
(size-Bytes tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Bytes' type
Compute length of serialized 'Bytes' type
(size-Double tag value)
(size-Double tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Double' type
Compute length of serialized 'Double' type
(size-embedded tag item)
Compute length of serialized embedded type, including the metadata header
Compute length of serialized embedded type, including the metadata header
(size-Enum tag value)
(size-Enum tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Enum' type
Compute length of serialized 'Enum' type
(size-Fixed32 tag value)
(size-Fixed32 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Fixed32' type
Compute length of serialized 'Fixed32' type
(size-Fixed64 tag value)
(size-Fixed64 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Fixed64' type
Compute length of serialized 'Fixed64' type
(size-Float tag value)
(size-Float tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Float' type
Compute length of serialized 'Float' type
(size-Int32 tag value)
(size-Int32 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Int32' type
Compute length of serialized 'Int32' type
(size-Int64 tag value)
(size-Int64 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'Int64' type
Compute length of serialized 'Int64' type
(size-map constructor tag item)
Compute length of user format [key val] using given map item constructor
Compute length of user format [key val] using given map item constructor
(size-repeated f tag items)
Compute length of serialized repeated type
Compute length of serialized repeated type
(size-SFixed32 tag value)
(size-SFixed32 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'SFixed32' type
Compute length of serialized 'SFixed32' type
(size-SFixed64 tag value)
(size-SFixed64 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'SFixed64' type
Compute length of serialized 'SFixed64' type
(size-SInt32 tag value)
(size-SInt32 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'SInt32' type
Compute length of serialized 'SInt32' type
(size-SInt64 tag value)
(size-SInt64 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'SInt64' type
Compute length of serialized 'SInt64' type
(size-String tag value)
(size-String tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'String' type
Compute length of serialized 'String' type
(size-UInt32 tag value)
(size-UInt32 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'UInt32' type
Compute length of serialized 'UInt32' type
(size-UInt64 tag value)
(size-UInt64 tag {:keys [optimize] :or {optimize true} :as options} value)
Compute length of serialized 'UInt64' type
Compute length of serialized 'UInt64' type
(tag-map f is)
(tag-map init f is)
Returns a lazy sequence consisting of the result of applying f to the set of protobuf objects delimited by protobuf tags.
Value | Type | Description |
---|---|---|
init | map | A map of initial values |
f | (fn [tag index]) | An arity-2 function that accepts a tag and index and returns a [k v] (see Return type below) |
is | CodedInputStream | An input stream containing serialized protobuf data |
f should evaluate to a 2-entry vector in the form [key value], where:
(tag-map
(fn [tag index]
(case index
1 [:currency_code (cis->String is)]
2 [:units (cis->Int64 is)]
3 [:nanos (cis->Int32 is)]
[index (cis->undefined tag is)]))
is))
Returns a lazy sequence consisting of the result of applying f to the set of protobuf objects delimited by protobuf tags. #### Parameters | Value | Type | Description | |----------|--------------------|------------------------------------------------------------------------------------------------| | **init** | _map_ | A map of initial values | | **f** | _(fn [tag index])_ | An arity-2 function that accepts a tag and index and returns a [k v] (see _Return type_ below) | | **is** | [CodedInputStream](https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/CodedInputStream) | An input stream containing serialized protobuf data | #### Return Type _f_ should evaluate to a 2-entry vector in the form [key value], where: - _key_ is either - a keyword representing the field name when the index is known - simply the index value when it is not - _value_ is either - a value that will be returned verbatim to be associated to the _key_ - a function that will take a collection of previously deserialized values with the same tag and update it to incorporate the new value (to support _repeated_ types, etc) #### Example ``` (tag-map (fn [tag index] (case index 1 [:currency_code (cis->String is)] 2 [:units (cis->Int64 is)] 3 [:nanos (cis->Int32 is)] [index (cis->undefined tag is)])) is)) ```
(write-Bool tag value os)
(write-Bool tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Bool' type
Serialize a 'Bool' type
(write-Bytes tag value os)
(write-Bytes tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize 'Bytes' type
Serialize 'Bytes' type
(write-Double tag value os)
(write-Double tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Double' type
Serialize a 'Double' type
(write-embedded tag item os)
Serialize an embedded type along with tag/length metadata
Serialize an embedded type along with tag/length metadata
(write-Enum tag value os)
(write-Enum tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Enum' type
Serialize a 'Enum' type
(write-Fixed32 tag value os)
(write-Fixed32 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Fixed32' type
Serialize a 'Fixed32' type
(write-Fixed64 tag value os)
(write-Fixed64 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Fixed64' type
Serialize a 'Fixed64' type
(write-Float tag value os)
(write-Float tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Float' type
Serialize a 'Float' type
(write-Int32 tag value os)
(write-Int32 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Int32' type
Serialize a 'Int32' type
(write-Int64 tag value os)
(write-Int64 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'Int64' type
Serialize a 'Int64' type
(write-map constructor tag items os)
Serialize user format [key val] using given map item constructor
Serialize user format [key val] using given map item constructor
(write-repeated f tag items os)
Serialize a repeated type
Serialize a repeated type
(write-SFixed32 tag value os)
(write-SFixed32 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'SFixed32' type
Serialize a 'SFixed32' type
(write-SFixed64 tag value os)
(write-SFixed64 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'SFixed64' type
Serialize a 'SFixed64' type
(write-SInt32 tag value os)
(write-SInt32 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'SInt32' type
Serialize a 'SInt32' type
(write-SInt64 tag value os)
(write-SInt64 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'SInt64' type
Serialize a 'SInt64' type
(write-String tag value os)
(write-String tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'String' type
Serialize a 'String' type
(write-UInt32 tag value os)
(write-UInt32 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'UInt32' type
Serialize a 'UInt32' type
(write-UInt64 tag value os)
(write-UInt64 tag {:keys [optimize] :or {optimize true} :as options} value os)
Serialize a 'UInt64' type
Serialize a 'UInt64' type
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close