#[non_exhaustive]pub struct DecodeLimits {
pub max_grid_points_decoded: Option<u32>,
pub max_tiles_decoded: Option<u32>,
}Expand description
User-configurable limits for decoding. Use this struct if your application requires resource guards.
For example, resource guarding is likely unnecessary for applications running on a personal computing environment with ample memory. It is also unnecessary when you know that the input data contains only a small number of grid points. On the other hand, resource guarding is recommended for applications running on shared computing environments or when processing input data containing a large number of grid points from an unknown source.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_grid_points_decoded: Option<u32>Maximum number of grid points to be decoded per submessage. None means
no additional limit.
According to the GRIB2 specification, a single submessage can contain up
to u32::MAX grid points (although the developers of this library have
never encountered a submessage containing that many grid points).
Depending on the decoding method, it may be necessary to allocate a
large buffer to store the values of all grid points. If u32::MAX grid
points are stored as an f32 array, a 16 GiB buffer is required.
This configuration option is intended to prevent such massive
allocations. It is currently effective in the Template 5.40/7.40 (JPEG
2000 code stream format) decoder when jpeg2000-unpack-with-hayro is
enabled.
max_tiles_decoded: Option<u32>Maximum number of JPEG 2000 code stream tiles to be decoded per
submessage. None means no additional limit.
This configuration is currently effective in the Template 5.40/7.40
(JPEG 2000 code stream format) decoder when jpeg2000-unpack-with-hayro
is enabled.