Enum svgdom::AttributeValue
source · pub enum AttributeValue {
Show 17 variants
None,
Inherit,
CurrentColor,
AspectRatio(AspectRatio),
Color(Color),
FuncLink(Node),
Paint(Node, Option<PaintFallback>),
Length(Length),
LengthList(LengthList),
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)
Link(Node)
IRI
Number(f64)
NumberList(NumberList)
Path(Path)
Points(Points)
Transform(Transform)
ViewBox(ViewBox)
String(String)
Implementations
sourceimpl 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_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
sourceimpl Clone for AttributeValue
impl Clone for AttributeValue
sourcefn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for AttributeValue
impl Debug for AttributeValue
sourceimpl Display for AttributeValue
impl Display for AttributeValue
sourceimpl<'a> From<&'a str> for AttributeValue
impl<'a> From<&'a str> for AttributeValue
sourceimpl From<(f64, LengthUnit)> for AttributeValue
impl From<(f64, LengthUnit)> for AttributeValue
sourcefn from(value: (f64, LengthUnit)) -> Self
fn from(value: (f64, LengthUnit)) -> Self
Converts to this type from the input type.
sourceimpl From<(i32, LengthUnit)> for AttributeValue
impl From<(i32, LengthUnit)> for AttributeValue
sourcefn from(value: (i32, LengthUnit)) -> Self
fn from(value: (i32, LengthUnit)) -> Self
Converts to this type from the input type.
sourceimpl From<AspectRatio> for AttributeValue
impl From<AspectRatio> for AttributeValue
sourcefn from(value: AspectRatio) -> Self
fn from(value: AspectRatio) -> Self
Converts to this type from the input type.
sourceimpl From<Color> for AttributeValue
impl From<Color> for AttributeValue
sourceimpl From<Length> for AttributeValue
impl From<Length> for AttributeValue
sourceimpl From<LengthList> for AttributeValue
impl From<LengthList> for AttributeValue
sourcefn from(value: LengthList) -> Self
fn from(value: LengthList) -> Self
Converts to this type from the input type.
sourceimpl From<NumberList> for AttributeValue
impl From<NumberList> for AttributeValue
sourcefn from(value: NumberList) -> Self
fn from(value: NumberList) -> Self
Converts to this type from the input type.
sourceimpl From<PaintFallback> for AttributeValue
impl From<PaintFallback> for AttributeValue
sourcefn from(value: PaintFallback) -> Self
fn from(value: PaintFallback) -> Self
Converts to this type from the input type.
sourceimpl From<Path> for AttributeValue
impl From<Path> for AttributeValue
sourceimpl From<Points> for AttributeValue
impl From<Points> for AttributeValue
sourceimpl From<String> for AttributeValue
impl From<String> for AttributeValue
sourceimpl From<Transform> for AttributeValue
impl From<Transform> for AttributeValue
sourceimpl From<ViewBox> for AttributeValue
impl From<ViewBox> for AttributeValue
sourceimpl From<f64> for AttributeValue
impl From<f64> for AttributeValue
sourceimpl From<i32> for AttributeValue
impl From<i32> for AttributeValue
sourceimpl PartialEq<AttributeValue> for AttributeValue
impl PartialEq<AttributeValue> for AttributeValue
sourcefn eq(&self, other: &AttributeValue) -> bool
fn eq(&self, other: &AttributeValue) -> bool
sourceimpl WriteBuffer for AttributeValue
impl WriteBuffer for AttributeValue
sourcefn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)
Writes data to the
Vec<u8>
buffer using specified WriteOptions
.sourcefn 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
.sourcefn 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 !RefUnwindSafe for AttributeValue
impl !Send for AttributeValue
impl !Sync for AttributeValue
impl Unpin for AttributeValue
impl !UnwindSafe for AttributeValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more