Trait virtue::parse::AttributeAccess

source ·
pub trait AttributeAccess {
    // Required methods
    fn has_attribute<T: FromAttribute + PartialEq<T>>(
        &self,
        attrib: T
    ) -> Result<bool>;
    fn get_attribute<T: FromAttribute>(&self) -> Result<Option<T>>;
}
Expand description

Bring useful methods to access attributes of an element.

Required Methods§

source

fn has_attribute<T: FromAttribute + PartialEq<T>>( &self, attrib: T ) -> Result<bool>

Check to see if has the given attribute. See FromAttribute for more information.

note: Will immediately return Err(_) on the first error T returns.

source

fn get_attribute<T: FromAttribute>(&self) -> Result<Option<T>>

Returns the first attribute that returns Some(Self). See FromAttribute for more information.

note: Will immediately return Err(_) on the first error T returns.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AttributeAccess for Vec<Attribute>

Implementors§