pub(crate) trait NoArgsAttributeParser: 'static {
const PATH: &[Symbol];
const ALLOWED_TARGETS: AllowedTargets<'_>;
const STABILITY: AttributeStability;
const CREATE: fn(Span) -> AttributeKind;
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error;
const SAFETY: AttributeSafety = AttributeSafety::Normal;
// Provided method
fn finalize_check(_cx: &FinalizeContext<'_, '_>, _attr_span: Span) { ... }
}Expand description
An even simpler version of SingleAttributeParser:
now automatically check that there are no arguments provided to the attribute.
WithoutArgs<T> where T: NoArgsAttributeParser implements SingleAttributeParser.
Required Associated Constants§
const PATH: &[Symbol]
const ALLOWED_TARGETS: AllowedTargets<'_>
const STABILITY: AttributeStability
Sourceconst CREATE: fn(Span) -> AttributeKind
const CREATE: fn(Span) -> AttributeKind
Create the AttributeKind given attribute’s Span.
Provided Associated Constants§
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Error
const SAFETY: AttributeSafety = AttributeSafety::Normal
Provided Methods§
Sourcefn finalize_check(_cx: &FinalizeContext<'_, '_>, _attr_span: Span)
fn finalize_check(_cx: &FinalizeContext<'_, '_>, _attr_span: Span)
Optional cross-attribute validation, run once during finalization after all
attributes on the item have been parsed. Has access to the sibling attributes via
FinalizeContext::all_attrs, so it can reject incompatible combinations.
attr_span is the span of this attribute.
Defaults to a no-op.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".