Rectangle

Struct Rectangle 

Source
pub struct Rectangle {
    pub x: f32,
    pub y: f32,
    pub width: f32,
    pub height: f32,
    pub fill: Option<&'static str>,
    pub stroke: Option<&'static str>,
    pub stroke_width: Option<f32>,
    pub rx: Option<f32>,
    pub ry: Option<f32>,
    pub opacity: Option<f32>,
    pub id: Option<&'static str>,
    pub class: Option<&'static str>,
}
Expand description

Rectangle SVG element (<rect>).

See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect

Draws rectangles, defined by their position, width, and height. The rectangles may have their corners rounded. SVG Tutorial: SVG Basic Shape.

Fields§

§x: f32§y: f32§width: f32§height: f32§fill: Option<&'static str>§stroke: Option<&'static str>§stroke_width: Option<f32>§rx: Option<f32>§ry: Option<f32>§opacity: Option<f32>§id: Option<&'static str>§class: Option<&'static str>

Implementations§

Source§

impl Rectangle

Source

pub fn new(x: f32, y: f32, width: f32, height: f32) -> Self

Source

pub fn x(self, value: f32) -> Self

Source

pub fn y(self, value: f32) -> Self

Source

pub fn width(self, value: f32) -> Self

Source

pub fn height(self, value: f32) -> Self

Source

pub fn fill(self, value: &'static str) -> Self

Source

pub fn stroke(self, value: &'static str) -> Self

Source

pub fn stroke_width(self, value: f32) -> Self

Source

pub fn rx(self, value: f32) -> Self

Source

pub fn ry(self, value: f32) -> Self

Source

pub fn opacity(self, value: f32) -> Self

Source

pub fn id(self, value: &'static str) -> Self

Source

pub fn class(self, value: &'static str) -> Self

Trait Implementations§

Source§

impl Default for Rectangle

Source§

fn default() -> Self

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

impl Display for Rectangle

Source§

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

Formats the value using the given formatter. 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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.