pub enum Computed<'d> {
Value(Value<'d>),
Name(&'d [u8]),
Int(i64),
Float(f64),
}Expand description
One value a projection worked out.
A projection answers numbers and key names rather than places in a document,
which is why it is not a Value. The two number kinds are apart because
the reference writes $.a + $.b as 7 and $.list.sum() as 7.0, and a
client reading the reply back as JSON sees the difference.
Variants§
Value(Value<'d>)
A value the document holds.
Name(&'d [u8])
A key name, which is what ~ answers.
Int(i64)
A whole number.
Float(f64)
A number that is not whole.
Implementations§
Source§impl Computed<'_>
impl Computed<'_>
Sourcepub fn write_json_at(
&self,
f: &Format<'_>,
out: &mut Vec<u8>,
depth: usize,
) -> Result<()>
pub fn write_json_at( &self, f: &Format<'_>, out: &mut Vec<u8>, depth: usize, ) -> Result<()>
This as JSON text, appended to out, as if it sat depth levels inside
whatever the caller has already opened.
§Errors
A document that arrived damaged, and a number that is not finite, which JSON has no way to write.
Trait Implementations§
Auto Trait Implementations§
impl<'d> Freeze for Computed<'d>
impl<'d> RefUnwindSafe for Computed<'d>
impl<'d> Send for Computed<'d>
impl<'d> Sync for Computed<'d>
impl<'d> Unpin for Computed<'d>
impl<'d> UnsafeUnpin for Computed<'d>
impl<'d> UnwindSafe for Computed<'d>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more