pub enum Attribute<'a> {
Codama(CodamaAttribute<'a>),
Derive(DeriveAttribute<'a>),
Repr(ReprAttribute<'a>),
Unsupported(UnsupportedAttribute<'a>),
}Variants§
Codama(CodamaAttribute<'a>)
Derive(DeriveAttribute<'a>)
Repr(ReprAttribute<'a>)
Unsupported(UnsupportedAttribute<'a>)
Implementations§
Source§impl<'a> Attribute<'a>
impl<'a> Attribute<'a>
pub fn parse(ast: &'a Attribute, ctx: &AttributeContext<'_>) -> Result<Self>
Sourcepub fn parse_from(
ast: &'a Attribute,
effective: &Attribute,
ctx: &AttributeContext<'_>,
) -> Result<Self>
pub fn parse_from( ast: &'a Attribute, effective: &Attribute, ctx: &AttributeContext<'_>, ) -> Result<Self>
Parse an attribute using the effective attribute for content extraction.
ast is stored as the original attribute reference (for error spans).
effective is used to determine the attribute type and parse its content.
pub fn ast(&self) -> &Attribute
pub fn name(&self) -> String
Trait Implementations§
Source§impl<'a> From<CodamaAttribute<'a>> for Attribute<'a>
impl<'a> From<CodamaAttribute<'a>> for Attribute<'a>
Source§fn from(value: CodamaAttribute<'a>) -> Self
fn from(value: CodamaAttribute<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<DeriveAttribute<'a>> for Attribute<'a>
impl<'a> From<DeriveAttribute<'a>> for Attribute<'a>
Source§fn from(value: DeriveAttribute<'a>) -> Self
fn from(value: DeriveAttribute<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ReprAttribute<'a>> for Attribute<'a>
impl<'a> From<ReprAttribute<'a>> for Attribute<'a>
Source§fn from(value: ReprAttribute<'a>) -> Self
fn from(value: ReprAttribute<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<UnsupportedAttribute<'a>> for Attribute<'a>
impl<'a> From<UnsupportedAttribute<'a>> for Attribute<'a>
Source§fn from(value: UnsupportedAttribute<'a>) -> Self
fn from(value: UnsupportedAttribute<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a AccountDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a AccountDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a ArgumentDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a ArgumentDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a CodamaAttribute<'a>
impl<'a> TryFrom<&'a Attribute<'a>> for &'a CodamaAttribute<'a>
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a DefaultValueDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a DefaultValueDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a DeriveAttribute<'a>
impl<'a> TryFrom<&'a Attribute<'a>> for &'a DeriveAttribute<'a>
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a DiscriminatorDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a DiscriminatorDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a EncodingDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a EncodingDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a EnumDiscriminatorDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a EnumDiscriminatorDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a ErrorDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a ErrorDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a FieldDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a FieldDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a FixedSizeDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a FixedSizeDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a NameDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a NameDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a PdaDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a PdaDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a ReprAttribute<'a>
impl<'a> TryFrom<&'a Attribute<'a>> for &'a ReprAttribute<'a>
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a SeedDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a SeedDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a SizePrefixDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a SizePrefixDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a TypeDirective
impl<'a> TryFrom<&'a Attribute<'a>> for &'a TypeDirective
Source§impl<'a> TryFrom<&'a Attribute<'a>> for &'a UnsupportedAttribute<'a>
impl<'a> TryFrom<&'a Attribute<'a>> for &'a UnsupportedAttribute<'a>
impl<'a> StructuralPartialEq for Attribute<'a>
Auto Trait Implementations§
impl<'a> Freeze for Attribute<'a>
impl<'a> RefUnwindSafe for Attribute<'a>
impl<'a> !Send for Attribute<'a>
impl<'a> !Sync for Attribute<'a>
impl<'a> Unpin for Attribute<'a>
impl<'a> UnwindSafe for Attribute<'a>
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