pub struct ResourceLimits { /* private fields */ }Expand description
Validated semantic resource ceilings for one render.
Every limit is a deterministic, logical ceiling evaluated by the
renderer’s own accounting, never a measurement of the process: the
same scene and request cross the same limit on every target.
Equality is accepted. Start from ResourceLimits::default (or
ResourceLimits::builder) and lower the limits that matter for
your deployment; no limit can be raised above
ResourceLimits::absolute_maxima.
max_working_bytes budgets the renderer’s canonical logical working
set, not allocator usage: actual peak memory is higher, notably for
PNG, whose raster surfaces are bounded by max_raster_dimension and
max_raster_surface_pixels. See the crate documentation’s section
on serving untrusted input.
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn builder() -> ResourceLimitsBuilder
pub fn builder() -> ResourceLimitsBuilder
Starts a builder from the revision-1 default profile.
Sourcepub const fn absolute_maxima() -> &'static Self
pub const fn absolute_maxima() -> &'static Self
Returns the immutable absolute-maximum profile.
Sourcepub const fn max_scene_bytes(&self) -> u64
pub const fn max_scene_bytes(&self) -> u64
Returns the configured max_scene_bytes ceiling: Bytes of the admitted scene document. Measured in bytes.
Sourcepub const fn max_elements(&self) -> u32
pub const fn max_elements(&self) -> u32
Returns the configured max_elements ceiling: Source element occurrences: every member of the scene’s elements array, live or deleted. Measured in element occurrences.
Sourcepub const fn max_asset_entries(&self) -> u32
pub const fn max_asset_entries(&self) -> u32
Returns the configured max_asset_entries ceiling: Asset entries: members of the scene’s files map. Measured in asset entries.
Sourcepub const fn max_asset_bytes(&self) -> u64
pub const fn max_asset_bytes(&self) -> u64
Returns the configured max_asset_bytes ceiling: Bytes of any one asset payload. Measured in bytes.
Sourcepub const fn max_total_asset_bytes(&self) -> u64
pub const fn max_total_asset_bytes(&self) -> u64
Returns the configured max_total_asset_bytes ceiling: Bytes of all asset payloads together; at least max_asset_bytes. Measured in bytes.
Sourcepub const fn max_relationship_depth(&self) -> u32
pub const fn max_relationship_depth(&self) -> u32
Returns the configured max_relationship_depth ceiling: Depth of element relationship traversal, such as nested groups and frames. Measured in levels.
Sourcepub const fn max_nested_asset_depth(&self) -> u32
pub const fn max_nested_asset_depth(&self) -> u32
Returns the configured max_nested_asset_depth ceiling: Depth of assets nested inside SVG image assets. Measured in levels.
Sourcepub const fn max_nested_svg_nodes(&self) -> u32
pub const fn max_nested_svg_nodes(&self) -> u32
Returns the configured max_nested_svg_nodes ceiling: Nodes in any one nested SVG image. Measured in nodes.
Sourcepub const fn max_geometry_segments_per_element(&self) -> u32
pub const fn max_geometry_segments_per_element(&self) -> u32
Returns the configured max_geometry_segments_per_element ceiling: Geometry segments generated for any one element. Measured in segments.
Sourcepub const fn max_total_geometry_segments(&self) -> u64
pub const fn max_total_geometry_segments(&self) -> u64
Returns the configured max_total_geometry_segments ceiling: Geometry segments generated for the whole render; at least max_geometry_segments_per_element. Measured in segments.
Sourcepub const fn max_text_scalars_per_element(&self) -> u32
pub const fn max_text_scalars_per_element(&self) -> u32
Returns the configured max_text_scalars_per_element ceiling: Unicode scalars of text in any one element. Measured in Unicode scalar values.
Sourcepub const fn max_total_text_scalars(&self) -> u64
pub const fn max_total_text_scalars(&self) -> u64
Returns the configured max_total_text_scalars ceiling: Unicode scalars of text in the whole render; at least max_text_scalars_per_element. Measured in Unicode scalar values.
Sourcepub const fn max_raster_dimension(&self) -> u32
pub const fn max_raster_dimension(&self) -> u32
Returns the configured max_raster_dimension ceiling: Width or height of any decoded image or required raster surface. Measured in pixels per side.
Sourcepub const fn max_decoded_pixels_per_asset(&self) -> u64
pub const fn max_decoded_pixels_per_asset(&self) -> u64
Returns the configured max_decoded_pixels_per_asset ceiling: Decoded pixels of any one image asset. Measured in pixels.
Sourcepub const fn max_total_decoded_pixels(&self) -> u64
pub const fn max_total_decoded_pixels(&self) -> u64
Returns the configured max_total_decoded_pixels ceiling: Decoded pixels of all image assets together; at least max_decoded_pixels_per_asset. Measured in pixels.
Sourcepub const fn max_raster_surface_pixels(&self) -> u64
pub const fn max_raster_surface_pixels(&self) -> u64
Returns the configured max_raster_surface_pixels ceiling: Area of any one required raster surface: the PNG canvas, or a PDF raster fallback. Measured in pixels.
Sourcepub const fn max_total_rasterized_pixels(&self) -> u64
pub const fn max_total_rasterized_pixels(&self) -> u64
Returns the configured max_total_rasterized_pixels ceiling: Area of all raster surfaces together, placeholders included; at least max_raster_surface_pixels. Measured in pixels.
Sourcepub const fn max_svg_dimension(&self) -> f64
pub const fn max_svg_dimension(&self) -> f64
Returns the configured max_svg_dimension ceiling: Logical viewBox extent and final scaled width or height of an SVG. Measured in SVG user units.
Sourcepub const fn max_pdf_page_points(&self) -> f64
pub const fn max_pdf_page_points(&self) -> f64
Returns the configured max_pdf_page_points ceiling: PDF page width or height after padding and sizing. Measured in PDF points.
Sourcepub const fn max_coordinate_magnitude(&self) -> f64
pub const fn max_coordinate_magnitude(&self) -> f64
Returns the configured max_coordinate_magnitude ceiling: Magnitude of any normalized coordinate, dimension or transform value. Measured in scene units.
Sourcepub const fn max_diagnostics(&self) -> u32
pub const fn max_diagnostics(&self) -> u32
Returns the configured max_diagnostics ceiling: Diagnostics in one compatibility report. Measured in diagnostics.
Sourcepub const fn max_working_bytes(&self) -> u64
pub const fn max_working_bytes(&self) -> u64
Returns the configured max_working_bytes ceiling: Peak canonical logical working set. A deterministic budget, not an allocator cap: actual memory use is higher. Measured in logical bytes.
Sourcepub const fn max_output_bytes(&self) -> u64
pub const fn max_output_bytes(&self) -> u64
Returns the configured max_output_bytes ceiling: Bytes of the complete artifact. Measured in bytes.
Sourcepub const fn max_element_work_units(&self) -> u64
pub const fn max_element_work_units(&self) -> u64
Returns the configured max_element_work_units ceiling: Deterministic work spent on any one element. Measured in work units.
Sourcepub const fn max_asset_work_units(&self) -> u64
pub const fn max_asset_work_units(&self) -> u64
Returns the configured max_asset_work_units ceiling: Deterministic work spent on any one asset. Measured in work units.
Sourcepub const fn max_total_work_units(&self) -> u64
pub const fn max_total_work_units(&self) -> u64
Returns the configured max_total_work_units ceiling: Deterministic work spent on the whole render; at least max_element_work_units and max_asset_work_units. Measured in work units.
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Source§impl Default for ResourceLimits
impl Default for ResourceLimits
Source§impl PartialEq for ResourceLimits
impl PartialEq for ResourceLimits
impl StructuralPartialEq for ResourceLimits
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.