Skip to main content

ResourceLimits

Struct ResourceLimits 

Source
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

Source

pub fn builder() -> ResourceLimitsBuilder

Starts a builder from the revision-1 default profile.

Source

pub const fn absolute_maxima() -> &'static Self

Returns the immutable absolute-maximum profile.

Source

pub const fn max_scene_bytes(&self) -> u64

Returns the configured max_scene_bytes ceiling: Bytes of the admitted scene document. Measured in bytes.

Source

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.

Source

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.

Source

pub const fn max_asset_bytes(&self) -> u64

Returns the configured max_asset_bytes ceiling: Bytes of any one asset payload. Measured in bytes.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn max_diagnostics(&self) -> u32

Returns the configured max_diagnostics ceiling: Diagnostics in one compatibility report. Measured in diagnostics.

Source

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.

Source

pub const fn max_output_bytes(&self) -> u64

Returns the configured max_output_bytes ceiling: Bytes of the complete artifact. Measured in bytes.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResourceLimits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResourceLimits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ResourceLimits

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResourceLimits

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.