Struct svgdom::Attribute
[−]
[src]
pub struct Attribute { pub id: AttributeId, pub value: AttributeValue, pub visible: bool, }
Representation oh the SVG attribute object.
Fields
id: AttributeId
Internal ID of the attribute.
value: AttributeValue
Attribute value.
visible: bool
Visibility.
Unlike many other DOM implementations, libsvgdom supports hiding of the attributes,
instead removing them. Invisible attributes acts just like other attributes,
but they will not be printed during SVG writing. Unless you enable them via WriteOptions
.
All attributes are visible by default.
Methods
impl Attribute
[src]
fn new<T>(id: AttributeId, value: T) -> Attribute where AttributeValue: From<T>
Constructs a new attribute.
fn default(id: AttributeId) -> Option<Attribute>
Constructs a new attribute with default value, if it known.
fn check_is_default(&self) -> bool
Returns true
if current attribute's value is equal to default by SVG spec.
fn is_presentation(&self) -> bool
Returns true
if current attribute is part of
presentation attributes.
fn is_animation_event(&self) -> bool
Returns true
if current attribute is part of
animation event attributes.
fn is_graphical_event(&self) -> bool
Returns true
if current attribute is part of
graphical event attributes.
fn is_document_event(&self) -> bool
Returns true
if current attribute is part of
document event attributes.
fn is_conditional_processing(&self) -> bool
Returns true
if current attribute is part of
conditional processing attributes.
fn is_core(&self) -> bool
Returns true
if current attribute is part of
core attributes.
NOTE: the id
attribute is part of core attributes, but we don't store it here
since it's part of the Node
struct.
fn is_fill(&self) -> bool
Returns true
if current attribute is part of fill attributes.
List of fill attributes: fill
, fill-opacity
, fill-rule
.
This check is not defined by SVG spec.
fn is_stroke(&self) -> bool
Returns true
if current attribute is part of stroke attributes.
List of stroke attributes: stroke
, stroke-dasharray
, stroke-dashoffset
,
stroke-dashoffset
, stroke-linecap
, stroke-linejoin
, stroke-miterlimit
,
stroke-opacity
, stroke-width
.
This check is not defined by SVG spec.
fn is_color(&self) -> bool
fn is_length(&self) -> bool
fn is_length_list(&self) -> bool
fn is_link(&self) -> bool
fn is_func_link(&self) -> bool
fn is_number(&self) -> bool
fn is_number_list(&self) -> bool
fn is_path(&self) -> bool
fn is_predef_value(&self) -> bool
fn is_string(&self) -> bool
fn is_transform(&self) -> bool
Trait Implementations
impl PartialEq for Attribute
[src]
fn eq(&self, __arg_0: &Attribute) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Attribute) -> bool
This method tests for !=
.
impl Clone for Attribute
[src]
fn clone(&self) -> Attribute
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Attribute
[src]
impl WriteBuffer for Attribute
[src]
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)
Writes data to Vec<u8>
buffer using specified WriteOptions.
fn write_buf(&self, buf: &mut Vec<u8>)
Writes data to Vec<u8>
buffer using default WriteOptions.
impl Display for Attribute
[src]
impl WriteToString for Attribute
[src]
fn to_string_with_opt(&self, opt: &WriteOptions) -> String
Writes data to String
using specified WriteOptions.