Housekeeping
This commit is contained in:
parent
0940033223
commit
f7a96bd37f
2 changed files with 6 additions and 3 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
(defn wrapped-for-freezing? [x] (instance? WrappedForFreezing x))
|
(defn wrapped-for-freezing? [x] (instance? WrappedForFreezing x))
|
||||||
(defn wrap-for-freezing
|
(defn wrap-for-freezing
|
||||||
"Wraps arg (any freezable data type) so that (tools/freeze <wrapped-arg>)
|
"Wraps arg (any freezable data type) so that (tools/freeze <wrapped-arg>)
|
||||||
will freeze the arg using given options."
|
will serialize the arg using given options."
|
||||||
[value & [opts]] (WrappedForFreezing. value opts))
|
[value & [opts]] (WrappedForFreezing. value opts))
|
||||||
|
|
||||||
(defn freeze
|
(defn freeze
|
||||||
|
|
@ -28,7 +28,10 @@
|
||||||
(defn encrypted-frozen? [x] (instance? EncryptedFrozen x))
|
(defn encrypted-frozen? [x] (instance? EncryptedFrozen x))
|
||||||
|
|
||||||
(def ^:dynamic *thaw-opts* nil)
|
(def ^:dynamic *thaw-opts* nil)
|
||||||
(defmacro with-thaw-opts [opts & body] `(binding [*thaw-opts* ~opts] ~@body))
|
(defmacro with-thaw-opts
|
||||||
|
"Evaluates body using given options for any automatic deserialization in
|
||||||
|
context."
|
||||||
|
[opts & body] `(binding [*thaw-opts* ~opts] ~@body))
|
||||||
|
|
||||||
(defn thaw
|
(defn thaw
|
||||||
"Like `nippy/thaw` but takes options from *thaw-opts* binding, and wraps
|
"Like `nippy/thaw` but takes options from *thaw-opts* binding, and wraps
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue