diff --git a/lib/src/key/database.rs b/lib/src/key/database.rs index 1b392c73..3990adc0 100644 --- a/lib/src/key/database.rs +++ b/lib/src/key/database.rs @@ -56,7 +56,10 @@ impl Database { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/db.rs b/lib/src/key/db.rs index eac00055..2b804631 100644 --- a/lib/src/key/db.rs +++ b/lib/src/key/db.rs @@ -60,7 +60,10 @@ impl Db { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/dl.rs b/lib/src/key/dl.rs index c0357653..0e375487 100644 --- a/lib/src/key/dl.rs +++ b/lib/src/key/dl.rs @@ -64,7 +64,10 @@ impl Dl { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/dt.rs b/lib/src/key/dt.rs index 214175b2..efe76f71 100644 --- a/lib/src/key/dt.rs +++ b/lib/src/key/dt.rs @@ -64,7 +64,10 @@ impl Dt { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/ev.rs b/lib/src/key/ev.rs index 3a98b49e..126ada3d 100644 --- a/lib/src/key/ev.rs +++ b/lib/src/key/ev.rs @@ -68,7 +68,10 @@ impl Ev { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/fd.rs b/lib/src/key/fd.rs index 1eb833fc..1d43cbbe 100644 --- a/lib/src/key/fd.rs +++ b/lib/src/key/fd.rs @@ -68,7 +68,10 @@ impl Fd { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/ft.rs b/lib/src/key/ft.rs index f614ca3c..30d36dc1 100644 --- a/lib/src/key/ft.rs +++ b/lib/src/key/ft.rs @@ -68,7 +68,10 @@ impl Ft { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/guide.rs b/lib/src/key/guide.rs index 248faf72..971d2944 100644 --- a/lib/src/key/guide.rs +++ b/lib/src/key/guide.rs @@ -64,7 +64,10 @@ impl Guide { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/ix.rs b/lib/src/key/ix.rs index a34082cb..9e853405 100644 --- a/lib/src/key/ix.rs +++ b/lib/src/key/ix.rs @@ -68,7 +68,10 @@ impl Ix { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/kv.rs b/lib/src/key/kv.rs index a46243fa..17a5a11d 100644 --- a/lib/src/key/kv.rs +++ b/lib/src/key/kv.rs @@ -42,7 +42,10 @@ impl Kv { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize::(v)?) diff --git a/lib/src/key/lv.rs b/lib/src/key/lv.rs index 076e03b1..9b5aafee 100644 --- a/lib/src/key/lv.rs +++ b/lib/src/key/lv.rs @@ -68,7 +68,10 @@ impl Lv { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/namespace.rs b/lib/src/key/namespace.rs index 9433b762..e7e4d242 100644 --- a/lib/src/key/namespace.rs +++ b/lib/src/key/namespace.rs @@ -52,7 +52,10 @@ impl Namespace { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize::(v)?) diff --git a/lib/src/key/nl.rs b/lib/src/key/nl.rs index b9cb2861..287ffd2e 100644 --- a/lib/src/key/nl.rs +++ b/lib/src/key/nl.rs @@ -60,7 +60,10 @@ impl Nl { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/ns.rs b/lib/src/key/ns.rs index 675d7f96..e8e42d0b 100644 --- a/lib/src/key/ns.rs +++ b/lib/src/key/ns.rs @@ -56,7 +56,10 @@ impl Ns { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize::(v)?) diff --git a/lib/src/key/nt.rs b/lib/src/key/nt.rs index ccf76e5e..c6d04f48 100644 --- a/lib/src/key/nt.rs +++ b/lib/src/key/nt.rs @@ -60,7 +60,10 @@ impl Nt { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/sc.rs b/lib/src/key/sc.rs index a2d39bbf..50b83a40 100644 --- a/lib/src/key/sc.rs +++ b/lib/src/key/sc.rs @@ -64,7 +64,10 @@ impl Sc { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/st.rs b/lib/src/key/st.rs index 4a7e3ddc..d4bc1a74 100644 --- a/lib/src/key/st.rs +++ b/lib/src/key/st.rs @@ -72,7 +72,10 @@ impl St { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/table.rs b/lib/src/key/table.rs index 63d9533e..79e79a02 100644 --- a/lib/src/key/table.rs +++ b/lib/src/key/table.rs @@ -60,7 +60,10 @@ impl Table { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/tb.rs b/lib/src/key/tb.rs index 88279f35..ea1158b6 100644 --- a/lib/src/key/tb.rs +++ b/lib/src/key/tb.rs @@ -64,7 +64,10 @@ impl Tb { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?) diff --git a/lib/src/key/thing.rs b/lib/src/key/thing.rs index 2e0c56c3..5c68db42 100644 --- a/lib/src/key/thing.rs +++ b/lib/src/key/thing.rs @@ -65,7 +65,10 @@ impl Thing { } } pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) + crate::sql::serde::beg_internal_serialization(); + let v = serialize(self); + crate::sql::serde::end_internal_serialization(); + Ok(v?) } pub fn decode(v: &[u8]) -> Result { Ok(deserialize(v)?)