Enum AttributeValue

Source
pub enum AttributeValue {
Show 18 variants None, Inherit, CurrentColor, AspectRatio(AspectRatio), Color(Color), FuncLink(Node), Paint(Node, Option<PaintFallback>), Length(Length), LengthList(LengthList), Angle(Angle), Link(Node), Number(f64), NumberList(NumberList), Path(Path), Points(Points), Transform(Transform), ViewBox(ViewBox), String(String),
}
Expand description

Value of the SVG attribute.

Variants§

§

None

§

Inherit

§

CurrentColor

§

AspectRatio(AspectRatio)

§

Color(Color)

FuncIRI

§

Paint(Node, Option<PaintFallback>)

§

Length(Length)

§

LengthList(LengthList)

§

Angle(Angle)

IRI

§

Number(f64)

§

NumberList(NumberList)

§

Path(Path)

§

Points(Points)

§

Transform(Transform)

§

ViewBox(ViewBox)

§

String(String)

Implementations§

Source§

impl AttributeValue

Source

pub fn is_none(&self) -> bool

Source

pub fn is_inherit(&self) -> bool

Source

pub fn is_current_color(&self) -> bool

Source

pub fn is_aspect_ratio(&self) -> bool

Source

pub fn is_color(&self) -> bool

Source

pub fn is_length(&self) -> bool

Source

pub fn is_length_list(&self) -> bool

Source

pub fn is_angle(&self) -> bool

Source

pub fn is_paint(&self) -> bool

Source

pub fn is_number(&self) -> bool

Source

pub fn is_number_list(&self) -> bool

Source

pub fn is_path(&self) -> bool

Source

pub fn is_points(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_transform(&self) -> bool

Source

pub fn is_viewbox(&self) -> bool

Checks that the current attribute value contains a Node.

E.g. Link, FuncLink and Paint.

Source

pub fn default_value(id: AttributeId) -> Option<AttributeValue>

Constructs a new attribute value with a default value, if it’s known.

Trait Implementations§

Source§

impl Clone for AttributeValue

Source§

fn clone(&self) -> AttributeValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AttributeValue

Source§

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

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

impl Display for AttributeValue

Source§

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

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

impl<'a> From<&'a str> for AttributeValue

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<(f64, LengthUnit)> for AttributeValue

Source§

fn from(value: (f64, LengthUnit)) -> Self

Converts to this type from the input type.
Source§

impl From<(i32, LengthUnit)> for AttributeValue

Source§

fn from(value: (i32, LengthUnit)) -> Self

Converts to this type from the input type.
Source§

impl From<Angle> for AttributeValue

Source§

fn from(value: Angle) -> Self

Converts to this type from the input type.
Source§

impl From<AspectRatio> for AttributeValue

Source§

fn from(value: AspectRatio) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for AttributeValue

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Length> for AttributeValue

Source§

fn from(value: Length) -> Self

Converts to this type from the input type.
Source§

impl From<LengthList> for AttributeValue

Source§

fn from(value: LengthList) -> Self

Converts to this type from the input type.
Source§

impl From<NumberList> for AttributeValue

Source§

fn from(value: NumberList) -> Self

Converts to this type from the input type.
Source§

impl From<PaintFallback> for AttributeValue

Source§

fn from(value: PaintFallback) -> Self

Converts to this type from the input type.
Source§

impl From<Path> for AttributeValue

Source§

fn from(value: Path) -> Self

Converts to this type from the input type.
Source§

impl From<Points> for AttributeValue

Source§

fn from(value: Points) -> Self

Converts to this type from the input type.
Source§

impl From<String> for AttributeValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Transform> for AttributeValue

Source§

fn from(value: Transform) -> Self

Converts to this type from the input type.
Source§

impl From<ViewBox> for AttributeValue

Source§

fn from(value: ViewBox) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for AttributeValue

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for AttributeValue

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AttributeValue

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl WriteBuffer for AttributeValue

Source§

fn write_buf_opt(&self, opt: &ValueWriteOptions, buf: &mut Vec<u8>)

Writes data to the Vec<u8> buffer using specified WriteOptions.
Source§

fn write_buf(&self, buf: &mut Vec<u8>)

Writes data to the Vec<u8> buffer using default WriteOptions.
Source§

fn with_write_opt<'a>(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>
where Self: Sized,

Returns an object that implements fmt::Display using provided write options.
Source§

impl StructuralPartialEq for AttributeValue

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> 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> 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<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.