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 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 Parse for ForeignItem
impl Parse for ForeignItem
fn parse(input: ParseStream<'_>) -> Result<Self>
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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