pub(crate) struct Attr<'c, T> {
cx: &'c Ctxt,
name: Symbol,
tokens: TokenStream,
value: Option<T>,
}
Fields§
§cx: &'c Ctxt
§name: Symbol
§tokens: TokenStream
§value: Option<T>
Implementations§
source§impl<'c, T> Attr<'c, T>
impl<'c, T> Attr<'c, T>
fn none(cx: &'c Ctxt, name: Symbol) -> Self
fn set<A: ToTokens>(&mut self, obj: A, value: T)
fn set_opt<A: ToTokens>(&mut self, obj: A, value: Option<T>)
fn set_if_none(&mut self, value: T)
pub(crate) fn get(self) -> Option<T>
fn get_with_tokens(self) -> Option<(TokenStream, T)>
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