#[repr(C)]pub struct ImplItem<'ast> { /* private fields */ }
Expand description
An impl item like:
impl SomeItem {
const MAX: i32 = 9;
pub fn new(data: i32) -> Self {
Self(data)
}
}
impl Add for SomeItem {
type Output = Self;
fn add(self, other: Self) -> Self {
Self::new(self.0 + other.0)
}
}
unsafe impl Send for SomeItem {}
Implementations§
Source§impl<'ast> ImplItem<'ast>
impl<'ast> ImplItem<'ast>
pub fn is_unsafe(&self) -> bool
pub fn generics(&self) -> &GenericParams<'ast>
pub fn is_negated(&self) -> bool
pub fn is_trait_impl(&self) -> bool
pub fn trait_ref(&self) -> Option<&TraitRef<'ast>>
pub fn items(&self) -> &[AssocItemKind<'ast>]
pub fn ty(&self) -> TyKind<'_>
Trait Implementations§
Source§impl<'ast> ItemData<'ast> for ImplItem<'ast>
impl<'ast> ItemData<'ast> for ImplItem<'ast>
Source§fn id(&self) -> ItemId
fn id(&self) -> ItemId
Returns the
ItemId
of this item. This is a unique identifier used for comparison
and to request items from the MarkerContext
.Source§fn visibility(&self) -> &Visibility<'ast>
fn visibility(&self) -> &Visibility<'ast>
The
Visibility
of this item.Source§fn ident(&self) -> Option<&Ident<'ast>>
fn ident(&self) -> Option<&Ident<'ast>>
This function can return
None
if the item was generated and has no real nameAuto Trait Implementations§
impl<'ast> Freeze for ImplItem<'ast>
impl<'ast> RefUnwindSafe for ImplItem<'ast>
impl<'ast> !Send for ImplItem<'ast>
impl<'ast> !Sync for ImplItem<'ast>
impl<'ast> Unpin for ImplItem<'ast>
impl<'ast> UnwindSafe for ImplItem<'ast>
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