pub struct JsonShape {
pub top_level: TopLevel,
pub item_count: usize,
pub is_uniform_array: bool,
pub max_depth: usize,
pub char_count: usize,
}Expand description
Structural characteristics of a JSON value.
Produced by analyze and consumed by select_strategy to decide
whether TOON or JSON encoding is more token-efficient.
Fields§
§top_level: TopLevelThe top-level JSON type.
item_count: usizeNumber of items if top-level is an array, 0 otherwise.
is_uniform_array: booltrue if top-level is an array and all items are objects with identical key sets.
max_depth: usizeMaximum nesting depth (0 for flat values).
char_count: usizeTotal character count of the pretty-printed JSON representation.
Trait Implementations§
Auto Trait Implementations§
impl Forget for JsonShape
impl Freeze for JsonShape
impl Move for JsonShape
impl RefUnwindSafe for JsonShape
impl Send for JsonShape
impl Sync for JsonShape
impl Unpin for JsonShape
impl UnsafeUnpin for JsonShape
impl UnwindSafe for JsonShape
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
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