Skip to main content

PrecomputeSize

Trait PrecomputeSize 

Source
pub trait PrecomputeSize {
    // Required method
    fn pre_compute_size(&self, options: &Options, sizes: &mut Vec<Size>) -> Size;
}
Expand description

Computation of the printed layout, ahead of printing.

Implementations push one Size per array/object encountered, in depth-first order, and return the size of the value itself.

Recurses once per nesting level; each level runs through on_sufficient_stack.

Required Methods§

Source

fn pre_compute_size(&self, options: &Options, sizes: &mut Vec<Size>) -> Size

Computes the printed size of this value, appending the size of each nested array and object to sizes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PrecomputeSize for bool

Source§

fn pre_compute_size(&self, _options: &Options, _sizes: &mut Vec<Size>) -> Size

Source§

impl<T> PrecomputeSize for &T
where T: PrecomputeSize + ?Sized,

Source§

fn pre_compute_size(&self, options: &Options, sizes: &mut Vec<Size>) -> Size

Implementors§

Source§

impl PrecomputeSize for Container

Source§

impl PrecomputeSize for ContainerKind

Source§

impl PrecomputeSize for Context

Source§

impl PrecomputeSize for ContextEntry

Source§

impl PrecomputeSize for ContextTypeEntry

Source§

impl PrecomputeSize for Direction

Source§

impl PrecomputeSize for EntryKeyRef<'_>

Source§

impl PrecomputeSize for EntryRef<'_>

Source§

impl PrecomputeSize for EntryValueRef<'_>

Source§

impl PrecomputeSize for Expanded

Source§

impl PrecomputeSize for Id

Source§

impl PrecomputeSize for Index

Source§

impl PrecomputeSize for Key

Source§

impl PrecomputeSize for LenientLangTag

Source§

impl PrecomputeSize for LenientLangTagBuf

Source§

impl PrecomputeSize for Nest

Source§

impl PrecomputeSize for Nullable<&Container>

Source§

impl PrecomputeSize for Nullable<&Id>

Source§

impl PrecomputeSize for Nullable<&IriRefBuf>

Source§

impl PrecomputeSize for Nullable<&LenientLangTagBuf>

Source§

impl PrecomputeSize for Nullable<&TermDefinition>

Source§

impl PrecomputeSize for Nullable<&Type>

Source§

impl PrecomputeSize for Nullable<&Vocab>

Source§

impl PrecomputeSize for Nullable<Direction>

Source§

impl PrecomputeSize for Nullable<IriRefBuf>

Source§

impl PrecomputeSize for Nullable<bool>

Source§

impl PrecomputeSize for Simple

Source§

impl PrecomputeSize for TermDefinition

Source§

impl PrecomputeSize for jsonld_syntax::context::definition::Type

Source§

impl PrecomputeSize for jsonld_syntax::context::term_definition::Type

Source§

impl PrecomputeSize for TypeContainer

Source§

impl PrecomputeSize for Value

Source§

impl PrecomputeSize for Version

Source§

impl PrecomputeSize for Vocab