Enum syn::ForeignItem
source · [−]#[non_exhaustive]
pub enum ForeignItem {
Fn(ForeignItemFn),
Static(ForeignItemStatic),
Type(ForeignItemType),
Macro(ForeignItemMacro),
Verbatim(TokenStream),
}
Expand description
An item within an extern
block.
This type is available only if Syn is built with the "full"
feature.
Syntax tree enum
This type is a syntax tree enum.
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
sourceimpl Clone for ForeignItem
impl Clone for ForeignItem
sourceimpl Debug for ForeignItem
impl Debug for ForeignItem
sourceimpl From<ForeignItemFn> for ForeignItem
impl From<ForeignItemFn> for ForeignItem
sourcefn from(e: ForeignItemFn) -> ForeignItem
fn from(e: ForeignItemFn) -> ForeignItem
Converts to this type from the input type.
sourceimpl From<ForeignItemMacro> for ForeignItem
impl From<ForeignItemMacro> for ForeignItem
sourcefn from(e: ForeignItemMacro) -> ForeignItem
fn from(e: ForeignItemMacro) -> ForeignItem
Converts to this type from the input type.
sourceimpl From<ForeignItemStatic> for ForeignItem
impl From<ForeignItemStatic> for ForeignItem
sourcefn from(e: ForeignItemStatic) -> ForeignItem
fn from(e: ForeignItemStatic) -> ForeignItem
Converts to this type from the input type.
sourceimpl From<ForeignItemType> for ForeignItem
impl From<ForeignItemType> for ForeignItem
sourcefn from(e: ForeignItemType) -> ForeignItem
fn from(e: ForeignItemType) -> ForeignItem
Converts to this type from the input type.
sourceimpl Hash for ForeignItem
impl Hash for ForeignItem
sourceimpl Parse for ForeignItem
impl Parse for ForeignItem
fn parse(input: ParseStream<'_>) -> Result<Self>
sourceimpl PartialEq<ForeignItem> for ForeignItem
impl PartialEq<ForeignItem> for ForeignItem
sourceimpl ToTokens for ForeignItem
impl ToTokens for ForeignItem
sourcefn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
sourcefn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
impl Eq for ForeignItem
Auto Trait Implementations
impl RefUnwindSafe for ForeignItem
impl !Send for ForeignItem
impl !Sync for ForeignItem
impl Unpin for ForeignItem
impl UnwindSafe for ForeignItem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
sourcefn 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. Read more