Liking cljdoc? Tell your friends :D

active.codecs.core


codec?clj

(codec? v)

Returns if v is a codec - both an encoder and a decoder.

Returns if `v` is a codec - both an encoder and a decoder.
raw docstring

conditionalclj

(conditional c f & args)

Returns a codec for a tuple of values, where the codec for the first one is c and for the second it's (apply f v args) where v is the first value.

Returns a codec for a tuple of values, where the codec for the
first one is `c` and for the second it's `(apply f v args)` where `v` is
the first value.
raw docstring

decodeclj

(decode codec codes)

Decodes the given sequence of codes according to the given codec, returning a decoder-error? or a tuple of [value rest-codes].

Decodes the given sequence of `codes` according to the given
`codec`, returning a [[decoder-error?]] or a tuple of `[value
rest-codes]`.
raw docstring

decode-fullclj

(decode-full codec codes)

Decodes the given sequence of codes according to the given codec, returning the decoded value. Throws if there are unread codes at the end, or too little codes for the codec, or any other problem.

Decodes the given sequence of `codes` according to the given
`codec`, returning the decoded value. Throws if there are unread
codes at the end, or too little codes for the codec, or any other
problem.
raw docstring

Decodercljprotocol

-decodeclj

(-decode this codes)

Must return [value rest-codes] or a decoder-error

Must return [value rest-codes] or a decoder-error

decoder-errorclj

(decoder-error msg & [data])

decoder-error?clj

(decoder-error? v)

decoder?clj

(decoder? v)

Returns if v is a decoder.

Returns if `v` is a decoder.
raw docstring

encodeclj

(encode codec value)

Encode with given value according to the given codec, returning a sequence of codes.

Encode with given `value` according to the given `codec`, returning
a sequence of codes.
raw docstring

Encodercljprotocol

-encodeclj

(-encode this value)

Must return a sequence of codes representing the given value.

Must return a sequence of codes representing the given value.

encoder?clj

(encoder? v)

Returns if v is an encoder.

Returns if `v` is an encoder.
raw docstring

length-prefixclj

(length-prefix length-codec coll-item-codec)

Returns a codec for a sequence of coll-item-codec of any length, where the length is encoded using length-codec and placed before the encoding of the collection items.

Returns a codec for a sequence of `coll-item-codec` of any length,
where the length is encoded using `length-codec` and placed before
the encoding of the collection items.
raw docstring

recordclj

(record key c & more)

Returns a codec for some named elements with different codecs. The encoded value should be a map of the given keys, and the code is a concatenation of the encodings of each item. E.g. the names are not encoded. Example:

(record :a int8 :b uint32)

Returns a codec for some named elements with different
codecs. The encoded value should be a map of the given keys, and the
code is a concatenation of the encodings of each item. E.g. the
names are not encoded. Example:

(record :a int8 :b uint32)
raw docstring

repeatclj

(repeat n c)

Returns a codec that is a seq of n times the same codec repeated.

Returns a codec that is a [[seq]] of `n` times the same codec repeated.
raw docstring

seqclj

(seq c & cs)

Returns a codec for a sequence of values, given codecs for each. The codes are concatenated into one.

Returns a codec for a sequence of values, given codecs for each. The codes are concatenated into one.
raw docstring

simple-codecclj

(simple-codec enc dec & args)

Creates a simple codec based on functions (apply enc value args) to encode, and (apply dec codes args) to decode.

Creates a simple codec based on functions `(apply enc value args)`
to encode, and `(apply dec codes args)` to decode.
raw docstring

simple-decoderclj

(simple-decoder dec & args)

Creates a simple decoder based on (apply dec value args) to encode.

Creates a simple decoder based on `(apply dec value args)` to
encode.
raw docstring

simple-encoderclj

(simple-encoder enc & args)

Creates a simple encoder based on (apply enc value args) to encode.

Creates a simple encoder based on `(apply enc value args)` to
encode.
raw docstring

singletonclj

The codec for the value representing one item of the code itself. This is also some kind of 'identity' codec.

The codec for the value representing one item of the code
itself. This is also some kind of 'identity' codec.
raw docstring

translateclj

(translate c enc dec & args)

Returns a codec like c, but the value encoded by c is (apply f value args) instead, and the decoded value of the returned value is (apply g value args) instead.

Returns a codec like c, but the value encoded by c is `(apply f
value args)` instead, and the decoded value of the returned value
is `(apply g value args)` instead.
raw docstring

try-decodeclj

(try-decode codec codes & [error-return])

Tries to decodes the given sequence of codes according to the given codec, returning the decoded value if successfull. Returns error-return, which defaults to nil, if there are unread codes at the end, or too little codes for the codec, or any other problem.

Tries to decodes the given sequence of `codes` according to the
given `codec`, returning the decoded value if successfull. Returns
`error-return`, which defaults to nil, if there are unread codes at
the end, or too little codes for the codec, or any other problem.
raw docstring

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

× close