[−][src]Struct amplify_derive_helpers::ParametrizedAttr
Representation for all allowed forms of #[attr(...)]
attribute.
If attribute has a multiple occurrences they are all assembled into a single
list. Repeated named arguments are not allowed and result in errors.
For situations like in #[attr("string literal")]
, ParametrizedAttr
will have a name
field set to attr
, literal
field set to
Lit::LitStr(LitStr("string literal"))
, args
will be an empty HashSet
and paths
will be represented by an empty vector.
Fields
name: Ident
Attribute name - attr
part of #[attr(...)]
args: HashMap<String, ArgValue>
All attribute arguments that have form of #[attr(ident = "literal")]
or #[attr(ident = TypeName)]
mapped to their name identifiers
paths: Vec<Path>
All attribute arguments that are paths or identifiers without any
specific value, like #[attr(std::io::Error, crate, super::SomeType)]
.
integers: Vec<LitInt>
Unnamed integer literals found within attribute arguments
literal: Option<Lit>
Unnamed literal value found in the list of attribute arguments.
If multiple literals are found they must be a string literals and
are concatenated into a single value, like it is done by the rust
compiler for #[doc = "..."]
attributes
Implementations
impl ParametrizedAttr
[src]
pub fn with_name(name: Ident) -> Self
[src]
pub fn with_attribute(attr: &Attribute) -> Result<Self, Error>
[src]
pub fn arg_literal_value(&self, name: &str) -> Result<Lit, Error>
[src]
pub fn has_verbatim(&self, verbatim: &str) -> bool
[src]
pub fn merge(&mut self, other: Self) -> Result<(), Error>
[src]
pub fn merged(mut self: Self, other: Self) -> Result<Self, Error>
[src]
pub fn enrich(&mut self, attr: &Attribute) -> Result<(), Error>
[src]
pub fn enriched(mut self: Self, attr: &Attribute) -> Result<Self, Error>
[src]
pub fn fuse(&mut self, nested: NestedMeta) -> Result<(), Error>
[src]
pub fn fused(mut self: Self, nested: NestedMeta) -> Result<Self, Error>
[src]
pub fn check(&self, _req: AttrReq) -> Result<(), Error>
[src]
pub fn checked(self, req: AttrReq) -> Result<Self, Error>
[src]
Trait Implementations
impl Clone for ParametrizedAttr
[src]
fn clone(&self) -> ParametrizedAttr
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for ParametrizedAttr
[src]
impl !Send for ParametrizedAttr
[src]
impl !Sync for ParametrizedAttr
[src]
impl Unpin for ParametrizedAttr
[src]
impl UnwindSafe for ParametrizedAttr
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,