pub struct Rendered<'s> { /* private fields */ }Expand description
An Interpolated document with its holes resolved, borrowed from the
compiled document and the context the call sees.
Made by Ctx::render. Each hole was
looked up once, when it was made; serializing writes the document’s
skeleton with each hole’s value in place, straight into the serializer
(BSON, SQL parameters, JWT claims, JSON), and builds no tree.
Rendered::to_owned builds one for the caller that needs it.
Implementations§
Source§impl Rendered<'_>
impl Rendered<'_>
Sourcepub fn to_owned(&self) -> OwnedDataValue
pub fn to_owned(&self) -> OwnedDataValue
The document as a tree, each hole’s value copied in.
It serializes as the Rendered does, but for one value: an integer
literal above i64::MAX, which OwnedDataValue holds as a float. So
18446744073709551615 is written with its digits by the Rendered
and as 1.8446744073709552e+19 by this tree.
Trait Implementations§
Source§impl Serialize for Rendered<'_>
impl Serialize for Rendered<'_>
Source§fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>
The skeleton with each hole’s value in place: a literal subtree as
its serde_json::Value holds it, objects and arrays entry by entry.
An object’s keys, a literal’s or not, come out as authored, in every
build: a Mongo {"$sort": {"created": -1, "_id": 1}} keeps its sort
order (3.x’s default build sorted the keys).