pub enum Item<'a> {
Block(&'a Block),
Const(&'a Const),
Enum(&'a Enum),
Field(&'a Field),
Fn(&'a Fn),
Local(&'a Local),
Mod(&'a Mod),
Struct(&'a Struct),
Trait(&'a Trait),
TypeAlias(&'a TypeAlias),
Use(&'a Use),
Variant(&'a Variant),
}Variants§
Block(&'a Block)
Const(&'a Const)
Enum(&'a Enum)
Field(&'a Field)
Fn(&'a Fn)
Local(&'a Local)
Mod(&'a Mod)
Struct(&'a Struct)
Trait(&'a Trait)
TypeAlias(&'a TypeAlias)
Use(&'a Use)
Variant(&'a Variant)
Implementations§
Source§impl<'a> PubItem<'a>
impl<'a> PubItem<'a>
pub fn as_block(&self) -> Option<&Block>
pub fn as_const(&self) -> Option<&Const>
pub fn as_field(&self) -> Option<&Field>
pub fn as_fn(&self) -> Option<&Fn>
pub fn as_local(&self) -> Option<&Local>
pub fn as_mod(&self) -> Option<&Mod>
pub fn as_struct(&self) -> Option<&Struct>
pub fn as_trait(&self) -> Option<&Trait>
pub fn as_type_alias(&self) -> Option<&TypeAlias>
pub fn as_use(&self) -> Option<&Use>
Trait Implementations§
Source§impl AttributeHelper for PubItem<'_>
impl AttributeHelper for PubItem<'_>
fn get_attributes(&self) -> Option<&Vec<Attribute>>
fn get_mut_attributes(&mut self) -> Option<&mut Vec<Attribute>>
fn get_attribute(&self, path: &str) -> Option<&Attribute>
fn get_mut_attribute(&mut self, path: &str) -> Option<&mut Attribute>
fn contains_attribute(&self, path: &str) -> bool
fn remove_attribute(&mut self, path: &str)
fn replace_attributes(&mut self, new: Vec<Attribute>) -> Vec<Attribute>
Source§fn insert_front(&mut self, front: Vec<Attribute>)
fn insert_front(&mut self, front: Vec<Attribute>)
Expands this vector by attaching the given value to the front of this vector.
Source§fn get_attribute_inner(&self, path: &str) -> Option<&TokenStream2>
fn get_attribute_inner(&self, path: &str) -> Option<&TokenStream2>
#[path(inner)]
Auto Trait Implementations§
impl<'a> Freeze for PubItem<'a>
impl<'a> !RefUnwindSafe for PubItem<'a>
impl<'a> !Send for PubItem<'a>
impl<'a> !Sync for PubItem<'a>
impl<'a> Unpin for PubItem<'a>
impl<'a> UnsafeUnpin for PubItem<'a>
impl<'a> !UnwindSafe for PubItem<'a>
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> 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