pub struct AttributeUsage {
pub name: &'static str,
pub description: Option<&'static str>,
pub source: Option<AttributeUsageSource>,
}Expand description
Describes a concrete usage of an attribute in source code.
Fields§
§name: &'static strContextual name for this usage (may differ across codebases).
description: Option<&'static str>Optional human-facing description for this usage.
source: Option<AttributeUsageSource>Optional source location to disambiguate multiple usages.
Implementations§
Source§impl AttributeUsage
impl AttributeUsage
Sourcepub const fn description(self, description: &'static str) -> Self
pub const fn description(self, description: &'static str) -> Self
Set a human-facing description for this usage.
Sourcepub const fn source(self, source: AttributeUsageSource) -> Self
pub const fn source(self, source: AttributeUsageSource) -> Self
Set a source location for this usage.
Trait Implementations§
Source§impl Clone for AttributeUsage
impl Clone for AttributeUsage
Source§fn clone(&self) -> AttributeUsage
fn clone(&self) -> AttributeUsage
Returns a duplicate 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 AttributeUsage
impl Debug for AttributeUsage
Source§impl Hash for AttributeUsage
impl Hash for AttributeUsage
Source§impl PartialEq for AttributeUsage
impl PartialEq for AttributeUsage
impl Copy for AttributeUsage
impl Eq for AttributeUsage
impl StructuralPartialEq for AttributeUsage
Auto Trait Implementations§
impl Freeze for AttributeUsage
impl RefUnwindSafe for AttributeUsage
impl Send for AttributeUsage
impl Sync for AttributeUsage
impl Unpin for AttributeUsage
impl UnsafeUnpin for AttributeUsage
impl UnwindSafe for AttributeUsage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more