pub struct NameValueAttribute { /* private fields */ }
Expand description
Represents a name-value
attribute like #[attribute(name="value")]
.
Implementations§
Source§impl NameValueAttribute
impl NameValueAttribute
pub fn empty(path: String, style: AttrStyle) -> Self
pub fn from_args( path: String, style: AttrStyle, args: LinkedHashSet<NameValue>, ) -> Self
pub fn new( path: &str, meta_items: Vec<MetaItem>, style: AttrStyle, ) -> Result<Self, NameValueError>
pub fn from_attribute_args( path: &str, attribute_args: AttributeArgs, style: AttrStyle, ) -> Result<Self, NameValueError>
pub fn path(&self) -> &str
pub fn style(&self) -> &AttrStyle
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, name: &str) -> Option<&Value>
pub fn contains(&self, name: &str) -> bool
pub fn iter(&self) -> Iter<'_> ⓘ
Trait Implementations§
Source§impl Clone for NameValueAttribute
impl Clone for NameValueAttribute
Source§fn clone(&self) -> NameValueAttribute
fn clone(&self) -> NameValueAttribute
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NameValueAttribute
impl Debug for NameValueAttribute
Source§impl Display for NameValueAttribute
impl Display for NameValueAttribute
Source§impl Hash for NameValueAttribute
impl Hash for NameValueAttribute
Source§impl<'a> Index<&'a str> for NameValueAttribute
impl<'a> Index<&'a str> for NameValueAttribute
Source§impl<'a> IntoIterator for &'a NameValueAttribute
impl<'a> IntoIterator for &'a NameValueAttribute
Source§impl IntoIterator for NameValueAttribute
impl IntoIterator for NameValueAttribute
Source§impl PartialEq for NameValueAttribute
impl PartialEq for NameValueAttribute
Source§impl TryFrom<Attribute> for NameValueAttribute
impl TryFrom<Attribute> for NameValueAttribute
impl Eq for NameValueAttribute
impl StructuralPartialEq for NameValueAttribute
Auto Trait Implementations§
impl Freeze for NameValueAttribute
impl RefUnwindSafe for NameValueAttribute
impl !Send for NameValueAttribute
impl !Sync for NameValueAttribute
impl Unpin for NameValueAttribute
impl UnwindSafe for NameValueAttribute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more