Struct svgdom::Attribute
[−]
[src]
pub struct Attribute { pub name: AttributeName, pub value: AttributeValue, pub visible: bool, }
Representation of the SVG attribute object.
Fields
name: AttributeName
Attribute name.
value: AttributeValue
Attribute value.
visible: bool
Visibility.
Unlike many other DOM implementations, libsvgdom supports hiding of the attributes,
instead of removing them. Invisible attributes act 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<'a, N, T>(name: N, value: T) -> Attribute where AttributeNameRef<'a>: From<N>, AttributeValue: From<T>
Constructs a new attribute.
fn id(&self) -> Option<AttributeId>
Returns an SVG attribute ID.
fn has_id(&self, id: AttributeId) -> bool
Returns true
if the attribute has the selected ID.
fn is_svg(&self) -> bool
Returns true
if the attribute is an SVG attribute.
fn default(id: AttributeId) -> Option<Attribute>
Constructs a new attribute with a default value, if it known.
fn check_is_default(&self) -> bool
Returns true
if the current attribute's value is equal to a default by the 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 the Vec<u8>
buffer using specified WriteOptions.
fn write_buf(&self, buf: &mut Vec<u8>)
Writes data to the 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 the String
using specified WriteOptions.
impl AttributeType for Attribute
[src]
fn is_presentation(&self) -> bool
Returns true
if the current attribute is part of presentation attributes. Read more
fn is_inheritable(&self) -> bool
Returns true
if the current attribute is part of inheritable presentation attributes. Read more
fn is_animation_event(&self) -> bool
Returns true
if the current attribute is part of animation event attributes. Read more
fn is_graphical_event(&self) -> bool
Returns true
if the current attribute is part of graphical event attributes. Read more
fn is_document_event(&self) -> bool
Returns true
if the current attribute is part of document event attributes. Read more
fn is_conditional_processing(&self) -> bool
Returns true
if the current attribute is part of conditional processing attributes . Read more
fn is_core(&self) -> bool
Returns true
if the current attribute is part of core attributes. Read more
fn is_fill(&self) -> bool
Returns true
if the current attribute is part of fill attributes. Read more
fn is_stroke(&self) -> bool
Returns true
if the current attribute is part of stroke attributes. Read more