pub struct JsonBody(pub Value);Expand description
JSON result body. Adapters that natively produce JSON
(HTTP/REST endpoints, the Jolokia JMX bridge, JSON-RPC) wrap
the parsed value here so verify: field assertions and
result-binding extractors can address nested keys (status,
value, etc.) without a re-parse step.
element_count follows the JSON-array convention: array
bodies report array.len(), scalar/object bodies report 1.
That makes await_empty polling work naturally against
endpoints whose “still running” state is a non-empty array
and “done” state is [].
Tuple Fields§
§0: ValueTrait Implementations§
Source§impl ResultBody for JsonBody
impl ResultBody for JsonBody
Source§fn element_count(&self) -> u64
fn element_count(&self) -> u64
Count of logical elements in this result (rows, records, items).
Used by the result traverser for metrics. Default 1 (one result).
Source§fn to_text(&self) -> String
fn to_text(&self) -> String
SRD-66 §“Surface 1” body projection — return the body’s
canonical text representation for use by result-binding
expressions (the magic
body: Str extern). Default
implementation falls back to serde_json::to_string
over to_json(); adapters with native text bodies (e.g.
TextBody, the CQL describe row) override to return
the underlying text directly.Source§fn byte_count(&self) -> Option<u64>
fn byte_count(&self) -> Option<u64>
Size in bytes of the result payload, if known.
Used by the result traverser for throughput metrics.
Auto Trait Implementations§
impl Freeze for JsonBody
impl RefUnwindSafe for JsonBody
impl Send for JsonBody
impl Sync for JsonBody
impl Unpin for JsonBody
impl UnsafeUnpin for JsonBody
impl UnwindSafe for JsonBody
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more