pub struct RenderSize {
pub width: u32,
pub height: u32,
}Expand description
Render size configuration. Non-zero pixel dimensions for the output raster image.
Width and height must be > 0 and <= i32::MAX to satisfy Skia’s
internal surface constraints. The total RGBA buffer must also fit
within the crate’s maximum render allocation.
Fields§
§width: u32§height: u32Implementations§
Source§impl RenderSize
impl RenderSize
Sourcepub fn new(width: u32, height: u32) -> Result<Self, SvgRenderError>
pub fn new(width: u32, height: u32) -> Result<Self, SvgRenderError>
Creates a new size after validating the dimensions.
§Errors
Returns SvgRenderError::InvalidSize if either dimension is zero
or exceeds i32::MAX, or if the resulting RGBA buffer would be too large.
Trait Implementations§
Source§impl Clone for RenderSize
impl Clone for RenderSize
Source§fn clone(&self) -> RenderSize
fn clone(&self) -> RenderSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RenderSize
Source§impl Debug for RenderSize
impl Debug for RenderSize
impl Eq for RenderSize
Source§impl PartialEq for RenderSize
impl PartialEq for RenderSize
Source§fn eq(&self, other: &RenderSize) -> bool
fn eq(&self, other: &RenderSize) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RenderSize
Auto Trait Implementations§
impl Freeze for RenderSize
impl RefUnwindSafe for RenderSize
impl Send for RenderSize
impl Sync for RenderSize
impl Unpin for RenderSize
impl UnsafeUnpin for RenderSize
impl UnwindSafe for RenderSize
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
Mutably borrows from an owned value. Read more