pub struct Attribute {
pub name: AttributeQName,
pub value: AttributeValue,
}
Expand description
Representation of the SVG attribute object.
Fields
name: AttributeQName
Attribute name.
value: AttributeValue
Attribute value.
Implementations
sourceimpl Attribute
impl Attribute
sourcepub fn new<'a, N, T>(name: N, value: T) -> Attributewhere
AttributeQNameRef<'a>: From<N>,
AttributeValue: From<T>,
pub fn new<'a, N, T>(name: N, value: T) -> Attributewhere
AttributeQNameRef<'a>: From<N>,
AttributeValue: From<T>,
Constructs a new attribute.
sourcepub fn new_default(id: AttributeId) -> Option<Attribute>
pub fn new_default(id: AttributeId) -> Option<Attribute>
Constructs a new attribute with a default value, if it known.
sourcepub fn id(&self) -> Option<AttributeId>
pub fn id(&self) -> Option<AttributeId>
Returns an SVG attribute ID.
sourcepub fn has_id(&self, id: AttributeId) -> bool
pub fn has_id(&self, id: AttributeId) -> bool
Returns true
if the attribute has the selected ID.
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
pub fn is_link_container(&self) -> bool
Trait Implementations
sourceimpl AttributeType for Attribute
impl AttributeType for Attribute
sourcefn is_presentation(&self) -> bool
fn is_presentation(&self) -> bool
sourcefn is_inheritable(&self) -> bool
fn is_inheritable(&self) -> bool
sourcefn is_animation_event(&self) -> bool
fn is_animation_event(&self) -> bool
sourcefn is_graphical_event(&self) -> bool
fn is_graphical_event(&self) -> bool
sourcefn is_document_event(&self) -> bool
fn is_document_event(&self) -> bool
sourcefn is_conditional_processing(&self) -> bool
fn is_conditional_processing(&self) -> bool
sourceimpl<'a, N> From<(N, (Node<NodeData>, Option<PaintFallback>))> for Attributewhere
AttributeQNameRef<'a>: From<N>,
N: Clone,
impl<'a, N> From<(N, (Node<NodeData>, Option<PaintFallback>))> for Attributewhere
AttributeQNameRef<'a>: From<N>,
N: Clone,
sourcefn from(v: (N, (Node, Option<PaintFallback>))) -> Self
fn from(v: (N, (Node, Option<PaintFallback>))) -> Self
Converts to this type from the input type.
sourceimpl<'a, N> From<(N, Node<NodeData>)> for Attributewhere
AttributeQNameRef<'a>: From<N>,
N: Clone,
impl<'a, N> From<(N, Node<NodeData>)> for Attributewhere
AttributeQNameRef<'a>: From<N>,
N: Clone,
sourceimpl<'a, N, V> From<(N, V)> for Attributewhere
AttributeQNameRef<'a>: From<N>,
AttributeValue: From<V>,
impl<'a, N, V> From<(N, V)> for Attributewhere
AttributeQNameRef<'a>: From<N>,
AttributeValue: From<V>,
sourceimpl WriteBuffer for Attribute
impl WriteBuffer for Attribute
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 Attribute
Auto Trait Implementations
impl !RefUnwindSafe for Attribute
impl !Send for Attribute
impl !Sync for Attribute
impl Unpin for Attribute
impl !UnwindSafe for Attribute
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