pub struct ResourceLimitsBuilder { /* private fields */ }Expand description
Builder for validated semantic resource ceilings.
Implementations§
Source§impl ResourceLimitsBuilder
impl ResourceLimitsBuilder
Sourcepub fn max_scene_bytes(self, value: u64) -> Self
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.
Sourcepub fn max_elements(self, value: u32) -> Self
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.
Sourcepub fn max_asset_entries(self, value: u32) -> Self
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.
Sourcepub fn max_asset_bytes(self, value: u64) -> Self
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.
Sourcepub fn max_total_asset_bytes(self, value: u64) -> Self
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.
Sourcepub fn max_relationship_depth(self, value: u32) -> Self
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.
Sourcepub fn max_nested_asset_depth(self, value: u32) -> Self
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.
Sourcepub fn max_nested_svg_nodes(self, value: u32) -> Self
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.
Sourcepub fn max_geometry_segments_per_element(self, value: u32) -> Self
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.
Sourcepub fn max_total_geometry_segments(self, value: u64) -> Self
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.
Sourcepub fn max_text_scalars_per_element(self, value: u32) -> Self
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.
Sourcepub fn max_total_text_scalars(self, value: u64) -> Self
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.
Sourcepub fn max_raster_dimension(self, value: u32) -> Self
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.
Sourcepub fn max_decoded_pixels_per_asset(self, value: u64) -> Self
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.
Sourcepub fn max_total_decoded_pixels(self, value: u64) -> Self
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.
Sourcepub fn max_raster_surface_pixels(self, value: u64) -> Self
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.
Sourcepub fn max_total_rasterized_pixels(self, value: u64) -> Self
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.
Sourcepub fn max_svg_dimension(self, value: f64) -> Self
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.
Sourcepub fn max_pdf_page_points(self, value: f64) -> Self
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.
Sourcepub fn max_coordinate_magnitude(self, value: f64) -> Self
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.
Sourcepub fn max_diagnostics(self, value: u32) -> Self
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.
Sourcepub fn max_working_bytes(self, value: u64) -> Self
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.
Sourcepub fn max_output_bytes(self, value: u64) -> Self
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.
Sourcepub fn max_element_work_units(self, value: u64) -> Self
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.
Sourcepub fn max_asset_work_units(self, value: u64) -> Self
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.
Sourcepub fn max_total_work_units(self, value: u64) -> Self
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
impl ResourceLimitsBuilder
Sourcepub fn build(self) -> Result<ResourceLimits, RequestError>
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
impl Clone for ResourceLimitsBuilder
Source§impl Debug for ResourceLimitsBuilder
impl Debug for ResourceLimitsBuilder
Auto Trait Implementations§
impl Freeze for ResourceLimitsBuilder
impl RefUnwindSafe for ResourceLimitsBuilder
impl Send for ResourceLimitsBuilder
impl Sync for ResourceLimitsBuilder
impl Unpin for ResourceLimitsBuilder
impl UnsafeUnpin for ResourceLimitsBuilder
impl UnwindSafe for ResourceLimitsBuilder
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.