Struct svgdom::Attributes
[−]
[src]
pub struct Attributes(_);
An attributes list.
Methods
impl Attributes
[src]
fn new() -> Attributes
[src]
Constructs a new attribute.
Warning: this method is for private use only. Never invoke it directly.
fn get<'a, N>(&self, name: N) -> Option<&Attribute> where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Returns an optional reference to Attribute
.
fn get_mut<'a, N>(&mut self, name: N) -> Option<&mut Attribute> where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Returns an optional mutable reference to Attribute
.
fn get_value<'a, N>(&self, name: N) -> Option<&AttributeValue> where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Returns an optional reference to AttributeValue
.
fn get_value_mut<'a, N>(&mut self, name: N) -> Option<&mut AttributeValue> where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Returns an optional mutable reference to AttributeValue
.
fn insert(&mut self, attr: Attribute)
[src]
Inserts a new attribute. Previous will be overwritten.
Panics
During insert of a linked attribute. Use Node::set_attribute()
instead.
Will panic only in debug build.
fn insert_from<'a, N, T>(&mut self, name: N, value: T) where
AttributeNameRef<'a>: From<N>,
AttributeValue: From<T>,
[src]
AttributeNameRef<'a>: From<N>,
AttributeValue: From<T>,
Creates a new attribute from name and value and inserts it. Previous will be overwritten.
Node
attribute value can be set only via Node::set_attribute()
method.
fn insert_impl(&mut self, attr: Attribute)
[src]
Inserts a new link attribute.
Warning: this method is for private use only. Never invoke it directly.
fn remove<'a, N>(&mut self, name: N) where
AttributeNameRef<'a>: From<N>,
N: Copy,
[src]
AttributeNameRef<'a>: From<N>,
N: Copy,
Removes an existing attribute.
Panics
During remove of a linked attribute. Use Node::remove_attribute()
instead.
Will panic only in debug build.
fn remove_impl<'a, N>(&mut self, name: N) where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Removes an existing attribute.
Warning: this method is for private use only. Never invoke it directly.
fn contains<'a, N>(&self, name: N) -> bool where
AttributeNameRef<'a>: From<N>,
[src]
AttributeNameRef<'a>: From<N>,
Returns true
if the container contains an attribute with such id
.
fn len(&self) -> usize
[src]
Returns count of the attributes.
fn is_empty(&self) -> bool
[src]
Returns true
if attributes is empty.
fn iter(&self) -> Iter<Attribute>
[src]
Returns an iterator.
fn iter_mut(&mut self) -> IterMut<Attribute>
[src]
Returns a mutable iterator.
fn iter_svg<'a>(
&'a self
) -> Map<SvgAttrFilter, fn(_: &'a Attribute) -> (AttributeId, &'a Attribute)>
[src]
&'a self
) -> Map<SvgAttrFilter, fn(_: &'a Attribute) -> (AttributeId, &'a Attribute)>
Returns an iterator over SVG attributes.
Shorthand for: iter().filter(|a| a.is_svg()).map(|a| (a.id().unwrap(), a))
fn iter_svg_mut<'a>(
&'a mut self
) -> Map<SvgAttrFilterMut, fn(_: &'a mut Attribute) -> (AttributeId, &'a mut Attribute)>
[src]
&'a mut self
) -> Map<SvgAttrFilterMut, fn(_: &'a mut Attribute) -> (AttributeId, &'a mut Attribute)>
Returns a mutable iterator over SVG attributes.
Shorthand for: iter_mut().filter(|a| a.is_svg()).map(|a| (a.id().unwrap(), a))
fn retain<F>(&mut self, f: F) where
F: FnMut(&Attribute) -> bool,
[src]
F: FnMut(&Attribute) -> bool,
Retains only elements specified by the predicate.
Panics
During remove of a linked attribute. Use Node::remove_attribute()
instead.
Will panic only in debug build.