pub enum Item {
Ink(InkItem),
Rust(Item),
}Expand description
An item in the root of the ink! module (ir::ItemMod).
This is either an ink! specific item or a normal Rust item.
Variants§
Implementations§
Source§impl Item
impl Item
Sourcepub fn is_ink_item(&self) -> bool
pub fn is_ink_item(&self) -> bool
Returns true if self is an ink! specific item.
Sourcepub fn is_rust_item(&self) -> bool
pub fn is_rust_item(&self) -> bool
Returns true if self is a normal Rust item.
Sourcepub fn map_ink_item(&self) -> Option<&InkItem>
pub fn map_ink_item(&self) -> Option<&InkItem>
Returns Some if self is an ink! specific item.
Otherwise, returns None.
Sourcepub fn map_rust_item(&self) -> Option<&Item>
pub fn map_rust_item(&self) -> Option<&Item>
Returns Some if self is an ink! specific item.
Otherwise, returns None.
Trait Implementations§
Source§impl ToTokens for Item
impl ToTokens for Item
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
We mainly implement this trait for this ink! type to have a derived
Spanned implementation for it.
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for Item
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl !Send for Item
impl !Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
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 moreSource§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.