Skip to main content

ResourceLimitsBuilder

Struct ResourceLimitsBuilder 

Source
pub struct ResourceLimitsBuilder { /* private fields */ }
Expand description

Builder for validated semantic resource ceilings.

Implementations§

Source§

impl ResourceLimitsBuilder

Source

pub fn max_scene_bytes(self, value: u64) -> Self

Sets the max_scene_bytes ceiling: Bytes of the admitted scene document.

Measured in bytes. Default 33_554_432; accepted values are at least 1 and at most 67_108_864, checked by build.

Source

pub fn max_elements(self, value: u32) -> Self

Sets the max_elements ceiling: Source element occurrences: every member of the scene’s elements array, live or deleted.

Measured in element occurrences. Default 16_384; accepted values are at least 1 and at most 65_536, checked by build.

Source

pub fn max_asset_entries(self, value: u32) -> Self

Sets the max_asset_entries ceiling: Asset entries: members of the scene’s files map.

Measured in asset entries. Default 1_024; accepted values are at least 1 and at most 4_096, checked by build.

Source

pub fn max_asset_bytes(self, value: u64) -> Self

Sets the max_asset_bytes ceiling: Bytes of any one asset payload.

Measured in bytes. Default 33_554_432; accepted values are at least 1 and at most 67_108_864, checked by build.

Source

pub fn max_total_asset_bytes(self, value: u64) -> Self

Sets the max_total_asset_bytes ceiling: Bytes of all asset payloads together; at least max_asset_bytes.

Measured in bytes. Default 134_217_728; accepted values are at least 1 and at most 268_435_456, checked by build.

Source

pub fn max_relationship_depth(self, value: u32) -> Self

Sets the max_relationship_depth ceiling: Depth of element relationship traversal, such as nested groups and frames.

Measured in levels. Default 64; accepted values are at least 1 and at most 128, checked by build.

Source

pub fn max_nested_asset_depth(self, value: u32) -> Self

Sets the max_nested_asset_depth ceiling: Depth of assets nested inside SVG image assets.

Measured in levels. Default 4; accepted values are at least 1 and at most 8, checked by build.

Source

pub fn max_nested_svg_nodes(self, value: u32) -> Self

Sets the max_nested_svg_nodes ceiling: Nodes in any one nested SVG image.

Measured in nodes. Default 65_536; accepted values are at least 1 and at most 262_144, checked by build.

Source

pub fn max_geometry_segments_per_element(self, value: u32) -> Self

Sets the max_geometry_segments_per_element ceiling: Geometry segments generated for any one element.

Measured in segments. Default 262_144; accepted values are at least 1 and at most 1_048_576, checked by build.

Source

pub fn max_total_geometry_segments(self, value: u64) -> Self

Sets the max_total_geometry_segments ceiling: Geometry segments generated for the whole render; at least max_geometry_segments_per_element.

Measured in segments. Default 4_194_304; accepted values are at least 1 and at most 16_777_216, checked by build.

Source

pub fn max_text_scalars_per_element(self, value: u32) -> Self

Sets the max_text_scalars_per_element ceiling: Unicode scalars of text in any one element.

Measured in Unicode scalar values. Default 262_144; accepted values are at least 1 and at most 1_048_576, checked by build.

Source

pub fn max_total_text_scalars(self, value: u64) -> Self

Sets the 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. Default 4_194_304; accepted values are at least 1 and at most 16_777_216, checked by build.

Source

pub fn max_raster_dimension(self, value: u32) -> Self

Sets the max_raster_dimension ceiling: Width or height of any decoded image or required raster surface.

Measured in pixels per side. Default 16_384; accepted values are at least 1 and at most 32_768, checked by build.

Source

pub fn max_decoded_pixels_per_asset(self, value: u64) -> Self

Sets the max_decoded_pixels_per_asset ceiling: Decoded pixels of any one image asset.

Measured in pixels. Default 16_777_216; accepted values are at least 1 and at most 67_108_864, checked by build.

Source

pub fn max_total_decoded_pixels(self, value: u64) -> Self

Sets the max_total_decoded_pixels ceiling: Decoded pixels of all image assets together; at least max_decoded_pixels_per_asset.

Measured in pixels. Default 33_554_432; accepted values are at least 1 and at most 134_217_728, checked by build.

Source

pub fn max_raster_surface_pixels(self, value: u64) -> Self

Sets the max_raster_surface_pixels ceiling: Area of any one required raster surface: the PNG canvas, or a PDF raster fallback.

Measured in pixels. Default 33_554_432; accepted values are at least 1 and at most 134_217_728, checked by build.

Source

pub fn max_total_rasterized_pixels(self, value: u64) -> Self

Sets the max_total_rasterized_pixels ceiling: Area of all raster surfaces together, placeholders included; at least max_raster_surface_pixels.

Measured in pixels. Default 67_108_864; accepted values are at least 1 and at most 268_435_456, checked by build.

Source

pub fn max_svg_dimension(self, value: f64) -> Self

Sets the max_svg_dimension ceiling: Logical viewBox extent and final scaled width or height of an SVG.

Measured in SVG user units. Default 1_000_000.0; accepted values are finite, positive and at most 10_000_000.0, checked by build.

Source

pub fn max_pdf_page_points(self, value: f64) -> Self

Sets the max_pdf_page_points ceiling: PDF page width or height after padding and sizing.

Measured in PDF points. Default 14_400.0; accepted values are finite, positive and at most 14_400.0, checked by build.

Source

pub fn max_coordinate_magnitude(self, value: f64) -> Self

Sets the max_coordinate_magnitude ceiling: Magnitude of any normalized coordinate, dimension or transform value.

Measured in scene units. Default 1e9; accepted values are finite, positive and at most 1e12, checked by build.

Source

pub fn max_diagnostics(self, value: u32) -> Self

Sets the max_diagnostics ceiling: Diagnostics in one compatibility report.

Measured in diagnostics. Default 65_536; accepted values are at least 1 and at most 262_144, checked by build.

Source

pub fn max_working_bytes(self, value: u64) -> Self

Sets the 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. Default 268_435_456; accepted values are at least 1 and at most 536_870_912, checked by build.

Source

pub fn max_output_bytes(self, value: u64) -> Self

Sets the max_output_bytes ceiling: Bytes of the complete artifact.

Measured in bytes. Default 134_217_728; accepted values are at least 1 and at most 536_870_912, checked by build.

Source

pub fn max_element_work_units(self, value: u64) -> Self

Sets the max_element_work_units ceiling: Deterministic work spent on any one element.

Measured in work units. Default 67_108_864; accepted values are at least 1 and at most 268_435_456, checked by build.

Source

pub fn max_asset_work_units(self, value: u64) -> Self

Sets the max_asset_work_units ceiling: Deterministic work spent on any one asset.

Measured in work units. Default 134_217_728; accepted values are at least 1 and at most 536_870_912, checked by build.

Source

pub fn max_total_work_units(self, value: u64) -> Self

Sets the 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. Default 4_294_967_296; accepted values are at least 1 and at most 17_179_869_184, checked by build.

Source§

impl ResourceLimitsBuilder

Source

pub fn build(self) -> Result<ResourceLimits, RequestError>

Validates and constructs the immutable resource-limit profile.

§Errors

Returns a RequestError with code request.invalid-resource-limit, naming the field, when a limit is zero, not finite, or above its absolute maximum, or when a per-item limit exceeds the aggregate it contributes to (for example max_asset_bytes above max_total_asset_bytes).

Trait Implementations§

Source§

impl Clone for ResourceLimitsBuilder

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 ResourceLimitsBuilder

Source§

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

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

impl Default for ResourceLimitsBuilder

Source§

fn default() -> Self

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

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.