Skip to main content

limit_rows

Function limit_rows 

Source
pub(crate) fn limit_rows(limits: &Limits) -> Vec<(String, String)>
Expand description

The device’s limits as label/value pairs, in the order the device reports them.

A [wgpu::Limits] is serialisable, so the labels and values come from its own serde description: the field names are the JSON object’s keys and the values are its entries. Nothing here names a limit, so a field wgpu adds is shown without a change, and a field it renames is not silently dropped.

The keys come out in the JSON object’s order, which serde_json keeps sorted rather than in declaration order; the list is stable and complete either way, and a reader looking a limit up benefits from the order.

Falls back to an empty list rather than failing: a panel that loses its limits is a cosmetic loss, and serialising a plain struct of integers has no way to fail.