Liking cljdoc? Tell your friends :D

protojure.protobuf.serdes

Serializer/deserializer support for fundamental protobuf types.

Serializer/deserializer support for fundamental protobuf types.
raw docstring

cis->Boolclj

(cis->Bool is)

Deserialize a 'Bool' type

Deserialize a 'Bool' type
raw docstring

cis->Bytesclj

(cis->Bytes is)

Deserialize 'Bytes' type

Deserialize 'Bytes' type
raw docstring

cis->Doubleclj

(cis->Double is)

Deserialize a 'Double' type

Deserialize a 'Double' type
raw docstring

cis->embeddedclj

(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
raw docstring

cis->Enumclj

(cis->Enum is)

Deserialize a 'Enum' type

Deserialize a 'Enum' type
raw docstring

cis->Fixed32clj

(cis->Fixed32 is)

Deserialize a 'Fixed32' type

Deserialize a 'Fixed32' type
raw docstring

cis->Fixed64clj

(cis->Fixed64 is)

Deserialize a 'Fixed64' type

Deserialize a 'Fixed64' type
raw docstring

cis->Floatclj

(cis->Float is)

Deserialize a 'Float' type

Deserialize a 'Float' type
raw docstring

cis->Int32clj

(cis->Int32 is)

Deserialize a 'Int32' type

Deserialize a 'Int32' type
raw docstring

cis->Int64clj

(cis->Int64 is)

Deserialize a 'Int64' type

Deserialize a 'Int64' type
raw docstring

cis->mapclj

(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]
raw docstring

cis->packablerepeatedclj

(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).
raw docstring

cis->packedrepeatedclj

(cis->packedrepeated f is)

Deserialize a 'packed' repeated type (see cis->packablerepeated)

Deserialize a 'packed' repeated type (see [[cis->packablerepeated]])
raw docstring

cis->repeatedclj

(cis->repeated f is)

Deserialize an 'unpacked' repeated type (see cis->packablerepeated)

Deserialize an 'unpacked' repeated type (see [[cis->packablerepeated]])
raw docstring

cis->SFixed32clj

(cis->SFixed32 is)

Deserialize a 'SFixed32' type

Deserialize a 'SFixed32' type
raw docstring

cis->SFixed64clj

(cis->SFixed64 is)

Deserialize a 'SFixed64' type

Deserialize a 'SFixed64' type
raw docstring

cis->SInt32clj

(cis->SInt32 is)

Deserialize a 'SInt32' type

Deserialize a 'SInt32' type
raw docstring

cis->SInt64clj

(cis->SInt64 is)

Deserialize a 'SInt64' type

Deserialize a 'SInt64' type
raw docstring

cis->Stringclj

(cis->String is)

Deserialize a 'String' type

Deserialize a 'String' type
raw docstring

cis->UInt32clj

(cis->UInt32 is)

Deserialize a 'UInt32' type

Deserialize a 'UInt32' type
raw docstring

cis->UInt64clj

(cis->UInt64 is)

Deserialize a 'UInt64' type

Deserialize a 'UInt64' type
raw docstring

cis->undefinedclj

(cis->undefined tag is)

Deserialize an unknown type, retaining its tag/type

Deserialize an unknown type, retaining its tag/type
raw docstring

size-Boolclj

(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
raw docstring

size-Bytesclj

(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
raw docstring

size-Doubleclj

(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
raw docstring

size-embeddedclj

(size-embedded tag item)

Compute length of serialized embedded type, including the metadata header

Compute length of serialized embedded type, including the metadata header
raw docstring

size-Enumclj

(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
raw docstring

size-Fixed32clj

(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
raw docstring

size-Fixed64clj

(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
raw docstring

size-Floatclj

(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
raw docstring

size-Int32clj

(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
raw docstring

size-Int64clj

(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
raw docstring

size-mapclj

(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
raw docstring

size-repeatedclj

(size-repeated f tag items)

Compute length of serialized repeated type

Compute length of serialized repeated type
raw docstring

size-SFixed32clj

(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
raw docstring

size-SFixed64clj

(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
raw docstring

size-SInt32clj

(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
raw docstring

size-SInt64clj

(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
raw docstring

size-Stringclj

(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
raw docstring

size-UInt32clj

(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
raw docstring

size-UInt64clj

(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
raw docstring

tag-mapclj

(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.

Parameters

ValueTypeDescription
initmapA 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)
isCodedInputStreamAn 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))
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))
```
raw docstring

write-Boolclj

(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
raw docstring

write-Bytesclj

(write-Bytes tag value os)
(write-Bytes tag {:keys [optimize] :or {optimize true} :as options} value os)

Serialize 'Bytes' type

Serialize 'Bytes' type
raw docstring

write-Doubleclj

(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
raw docstring

write-embeddedclj

(write-embedded tag item os)

Serialize an embedded type along with tag/length metadata

Serialize an embedded type along with tag/length metadata
raw docstring

write-Enumclj

(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
raw docstring

write-Fixed32clj

(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
raw docstring

write-Fixed64clj

(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
raw docstring

write-Floatclj

(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
raw docstring

write-Int32clj

(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
raw docstring

write-Int64clj

(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
raw docstring

write-mapclj

(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
raw docstring

write-repeatedclj

(write-repeated f tag items os)

Serialize a repeated type

Serialize a repeated type
raw docstring

write-SFixed32clj

(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
raw docstring

write-SFixed64clj

(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
raw docstring

write-SInt32clj

(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
raw docstring

write-SInt64clj

(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
raw docstring

write-Stringclj

(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
raw docstring

write-UInt32clj

(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
raw docstring

write-UInt64clj

(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
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close