Extension registry: records, sorted-collection helpers, user tags.
Extension registry: records, sorted-collection helpers, user tags.
(default-comparator? sorted-coll)True when sorted-coll uses the natural-ordering comparator that
sorted-set / sorted-map install by default.
True when `sorted-coll` uses the natural-ordering comparator that `sorted-set` / `sorted-map` install by default.
(record-info-by-class klass)(record-info-by-name classname)(register-record! klass)Register a Clojure defrecord OR Java record class so hako can encode and decode its instances.
Reflects on the class once, caches a MethodHandle for the canonical constructor (and per-field accessor MHs for Java records), and hands the resulting RecordInfo to the Java-side registry.
Register a Clojure defrecord OR Java record class so hako can encode and decode its instances. Reflects on the class once, caches a MethodHandle for the canonical constructor (and per-field accessor MHs for Java records), and hands the resulting RecordInfo to the Java-side registry.
(register-user-tag! id klass write-fn read-fn)Register a user extension tag id for klass. See ns docstring for
callback signatures.
id is a small non-negative integer (0..0x0FFFFFFF) that hako shifts
into the private wire range (0x10000000+). Callers pick 1, 2, 3...
per application; the shift is a compile-time add with no per-encode
cost. The full wire id (returned) can be passed to
register-user-tag-raw! for cross-app registrations.
Register a user extension tag `id` for `klass`. See ns docstring for callback signatures. `id` is a small non-negative integer (0..0x0FFFFFFF) that hako shifts into the private wire range (0x10000000+). Callers pick 1, 2, 3... per application; the shift is a compile-time add with no per-encode cost. The full wire id (returned) can be passed to `register-user-tag-raw!` for cross-app registrations.
(register-user-tag-raw! wire-id klass write-fn read-fn)Register with a full u32 wire id (0..0xFFFFFFFF). Escape hatch for
callers coordinating on an external id scheme; most callers should
use register-user-tag! with a small (0..0x0FFFFFFF) id.
Register with a full u32 wire id (0..0xFFFFFFFF). Escape hatch for callers coordinating on an external id scheme; most callers should use `register-user-tag!` with a small (0..0x0FFFFFFF) id.
(tagged-value? x)(user-tag-for-class klass)(user-tag-reader id)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |