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§
sourcefn has_attribute<T: FromAttribute + PartialEq<T>>(
&self,
attrib: T
) -> Result<bool>
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.
sourcefn get_attribute<T: FromAttribute>(&self) -> Result<Option<T>>
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.