#[non_exhaustive]pub enum ForeignItem {
Fn(ForeignItemFn),
Static(ForeignItemStatic),
Type(ForeignItemType),
Macro(ForeignItemMacro),
Verbatim(TokenStream),
}
Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fn(ForeignItemFn)
A foreign function in an extern
block.
Static(ForeignItemStatic)
A foreign static item in an extern
block: static ext: u8
.
Type(ForeignItemType)
A foreign type in an extern
block: type void
.
Macro(ForeignItemMacro)
A macro invocation within an extern block.
Verbatim(TokenStream)
Tokens in an extern
block not interpreted by Syn.
Trait Implementations§
Source§impl Clone for ForeignItem
impl Clone for ForeignItem
Source§impl Debug for ForeignItem
impl Debug for ForeignItem
Source§impl From<ForeignItemFn> for ForeignItem
impl From<ForeignItemFn> for ForeignItem
Source§fn from(e: ForeignItemFn) -> ForeignItem
fn from(e: ForeignItemFn) -> ForeignItem
Converts to this type from the input type.
Source§impl From<ForeignItemMacro> for ForeignItem
impl From<ForeignItemMacro> for ForeignItem
Source§fn from(e: ForeignItemMacro) -> ForeignItem
fn from(e: ForeignItemMacro) -> ForeignItem
Converts to this type from the input type.
Source§impl From<ForeignItemStatic> for ForeignItem
impl From<ForeignItemStatic> for ForeignItem
Source§fn from(e: ForeignItemStatic) -> ForeignItem
fn from(e: ForeignItemStatic) -> ForeignItem
Converts to this type from the input type.
Source§impl From<ForeignItemType> for ForeignItem
impl From<ForeignItemType> for ForeignItem
Source§fn from(e: ForeignItemType) -> ForeignItem
fn from(e: ForeignItemType) -> ForeignItem
Converts to this type from the input type.
Source§impl Hash for ForeignItem
impl Hash for ForeignItem
Source§impl Parse for ForeignItem
impl Parse for ForeignItem
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for ForeignItem
impl PartialEq for ForeignItem
Source§impl ToTokens for ForeignItem
impl ToTokens for ForeignItem
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
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 ForeignItem
Auto Trait Implementations§
impl Freeze for ForeignItem
impl RefUnwindSafe for ForeignItem
impl !Send for ForeignItem
impl !Sync for ForeignItem
impl Unpin for ForeignItem
impl UnwindSafe for ForeignItem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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.