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)
FuncLink(Node)
FuncIRI
Paint(Node, Option<PaintFallback>)
Length(Length)
LengthList(LengthList)
Angle(Angle)
Link(Node)
IRI
Number(f64)
NumberList(NumberList)
Path(Path)
Points(Points)
Transform(Transform)
ViewBox(ViewBox)
String(String)
Implementations§
Source§impl AttributeValue
impl AttributeValue
pub fn is_none(&self) -> bool
pub fn is_inherit(&self) -> bool
pub fn is_current_color(&self) -> bool
pub fn is_aspect_ratio(&self) -> bool
pub fn is_color(&self) -> bool
pub fn is_length(&self) -> bool
pub fn is_length_list(&self) -> bool
pub fn is_angle(&self) -> bool
pub fn is_link(&self) -> bool
pub fn is_func_link(&self) -> bool
pub fn is_paint(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_number_list(&self) -> bool
pub fn is_path(&self) -> bool
pub fn is_points(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_transform(&self) -> bool
pub fn is_viewbox(&self) -> bool
Sourcepub fn is_link_container(&self) -> bool
pub fn is_link_container(&self) -> bool
Checks that the current attribute value contains a Node
.
E.g. Link
, FuncLink
and Paint
.
Sourcepub fn default_value(id: AttributeId) -> Option<AttributeValue>
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
impl Clone for AttributeValue
Source§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AttributeValue
impl Debug for AttributeValue
Source§impl Display for AttributeValue
impl Display for AttributeValue
Source§impl<'a> From<&'a str> for AttributeValue
impl<'a> From<&'a str> for AttributeValue
Source§impl From<(f64, LengthUnit)> for AttributeValue
impl From<(f64, LengthUnit)> for AttributeValue
Source§fn from(value: (f64, LengthUnit)) -> Self
fn from(value: (f64, LengthUnit)) -> Self
Converts to this type from the input type.
Source§impl From<(i32, LengthUnit)> for AttributeValue
impl From<(i32, LengthUnit)> for AttributeValue
Source§fn from(value: (i32, LengthUnit)) -> Self
fn from(value: (i32, LengthUnit)) -> Self
Converts to this type from the input type.
Source§impl From<Angle> for AttributeValue
impl From<Angle> for AttributeValue
Source§impl From<AspectRatio> for AttributeValue
impl From<AspectRatio> for AttributeValue
Source§fn from(value: AspectRatio) -> Self
fn from(value: AspectRatio) -> Self
Converts to this type from the input type.
Source§impl From<Color> for AttributeValue
impl From<Color> for AttributeValue
Source§impl From<Length> for AttributeValue
impl From<Length> for AttributeValue
Source§impl From<LengthList> for AttributeValue
impl From<LengthList> for AttributeValue
Source§fn from(value: LengthList) -> Self
fn from(value: LengthList) -> Self
Converts to this type from the input type.
Source§impl From<NumberList> for AttributeValue
impl From<NumberList> for AttributeValue
Source§fn from(value: NumberList) -> Self
fn from(value: NumberList) -> Self
Converts to this type from the input type.
Source§impl From<PaintFallback> for AttributeValue
impl From<PaintFallback> for AttributeValue
Source§fn from(value: PaintFallback) -> Self
fn from(value: PaintFallback) -> Self
Converts to this type from the input type.
Source§impl From<Path> for AttributeValue
impl From<Path> for AttributeValue
Source§impl From<Points> for AttributeValue
impl From<Points> for AttributeValue
Source§impl From<String> for AttributeValue
impl From<String> for AttributeValue
Source§impl From<Transform> for AttributeValue
impl From<Transform> for AttributeValue
Source§impl From<ViewBox> for AttributeValue
impl From<ViewBox> for AttributeValue
Source§impl From<f64> for AttributeValue
impl From<f64> for AttributeValue
Source§impl From<i32> for AttributeValue
impl From<i32> for AttributeValue
Source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
Source§impl WriteBuffer for AttributeValue
impl WriteBuffer for AttributeValue
Source§fn write_buf_opt(&self, opt: &ValueWriteOptions, buf: &mut Vec<u8>)
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>)
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,
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.impl StructuralPartialEq for AttributeValue
Auto Trait Implementations§
impl Freeze for AttributeValue
impl !RefUnwindSafe for AttributeValue
impl !Send for AttributeValue
impl !Sync for AttributeValue
impl Unpin for AttributeValue
impl !UnwindSafe for AttributeValue
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