pub struct Item<K = ItemKind> {
pub attrs: Vec<Attribute>,
pub vis: Visibility,
pub kind: K,
}Fields§
§attrs: Vec<Attribute>§vis: Visibility§kind: KImplementations§
source§impl<K> Item<K>
impl<K> Item<K>
pub fn inherited(item: impl Into<K>) -> Self
pub fn public(item: impl Into<K>) -> Self
pub fn new(vis: Visibility, item: impl Into<K>) -> Self
pub fn with_attr(self, attr: Attribute) -> Self
pub fn add_attr(&mut self, attr: Attribute)
pub fn remove_attr(&mut self, index: usize) -> Attribute
Trait Implementations§
source§impl<K> AddVisibility<K> for Item<K>
impl<K> AddVisibility<K> for Item<K>
source§impl<I: Into<AssocItemKind>> From<I> for Item<AssocItemKind>
impl<I: Into<AssocItemKind>> From<I> for Item<AssocItemKind>
source§impl<K: Into<TokenStream>> From<Item<K>> for TokenStream
impl<K: Into<TokenStream>> From<Item<K>> for TokenStream
source§impl HasItem<Item<AssocItemKind>> for Impl
impl HasItem<Item<AssocItemKind>> for Impl
fn items(&self) -> &[AssocItem]
fn items_mut(&mut self) -> &mut Vec<AssocItem>
fn with_item(self, item: impl Into<Itm>) -> Selfwhere Self: Sized,
fn add_item(&mut self, item: impl Into<Itm>)
fn add_pub_item<K>(&mut self, item: impl Into<K>)where Itm: AddVisibility<K>,
fn with_pub_item<K>(self, item: impl Into<K>) -> Selfwhere Self: Sized, Itm: AddVisibility<K>,
fn remove_item(&mut self, index: usize) -> Option<Itm>
fn remove_item_by_id(&mut self, ident: &str) -> Option<Itm>
fn get_item(&self, index: usize) -> Option<&Itm>
fn get_item_by_id(&self, ident: &str) -> Option<&Itm>
source§impl HasItem<Item<AssocItemKind>> for TraitDef
impl HasItem<Item<AssocItemKind>> for TraitDef
fn items(&self) -> &[AssocItem]
fn items_mut(&mut self) -> &mut Vec<AssocItem>
fn with_item(self, item: impl Into<Itm>) -> Selfwhere Self: Sized,
fn add_item(&mut self, item: impl Into<Itm>)
fn add_pub_item<K>(&mut self, item: impl Into<K>)where Itm: AddVisibility<K>,
fn with_pub_item<K>(self, item: impl Into<K>) -> Selfwhere Self: Sized, Itm: AddVisibility<K>,
fn remove_item(&mut self, index: usize) -> Option<Itm>
fn remove_item_by_id(&mut self, ident: &str) -> Option<Itm>
fn get_item(&self, index: usize) -> Option<&Itm>
fn get_item_by_id(&self, ident: &str) -> Option<&Itm>
source§impl<K: MaybeIdent> MaybeIdent for Item<K>
impl<K: MaybeIdent> MaybeIdent for Item<K>
source§impl<K: PartialEq> PartialEq for Item<K>
impl<K: PartialEq> PartialEq for Item<K>
impl<K: Eq> Eq for Item<K>
impl<K> StructuralEq for Item<K>
impl<K> StructuralPartialEq for Item<K>
Auto Trait Implementations§
impl<K> RefUnwindSafe for Item<K>where K: RefUnwindSafe,
impl<K> Send for Item<K>where K: Send,
impl<K> Sync for Item<K>where K: Sync,
impl<K> Unpin for Item<K>where K: Unpin,
impl<K> UnwindSafe for Item<K>where K: UnwindSafe,
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