pub struct Attr<'c, T> { /* private fields */ }
Expand description
An attribute identified by a symbol
Implementations§
Source§impl<'c, T> Attr<'c, T>
impl<'c, T> Attr<'c, T>
Sourcepub fn set_opt<A: ToTokens>(&mut self, obj: A, value: Option<T>)
pub fn set_opt<A: ToTokens>(&mut self, obj: A, value: Option<T>)
Set an optional value of the attribute
Sourcepub fn set_if_none(&mut self, value: T)
pub fn set_if_none(&mut self, value: T)
Set oly if the attribute don’t have a value
Sourcepub fn get_with_tokens(self) -> Option<(TokenStream, T)>
pub fn get_with_tokens(self) -> Option<(TokenStream, T)>
Get the value along with the associatd tokens
Auto Trait Implementations§
impl<'c, T> Freeze for Attr<'c, T>where
T: Freeze,
impl<'c, T> !RefUnwindSafe for Attr<'c, T>
impl<'c, T> !Send for Attr<'c, T>
impl<'c, T> !Sync for Attr<'c, T>
impl<'c, T> Unpin for Attr<'c, T>where
T: Unpin,
impl<'c, T> !UnwindSafe for Attr<'c, T>
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