Skip to content

trimming: Allow "resetting" a subtree's size limit #5569

@loewenheim

Description

@loewenheim

It may be useful to allow the size of a field to exceed the limit of a surrounding container. This could be done via a mechanism that resets/introduces a new root for a subtree's size limits. As a contrived example:

struct Outer {
    #[metastructure(max_bytes = 10)
    inner: Inner,
}

struct Inner {
    first: String,
    #[metastructure(max_bytes = 10)]
    second: String,
}

Here, second would always have a "budget" of 10B, even if the 10B budget of inner was already (partially) depleted by first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions