pub fn expand_derive_extern_output(
    item_tokens: TokenStreamNightly,
) -> Result<TokenStreamNightly, syn::Error>
{
    // Get the name of the type we want to implement the trait for.
    let input: syn::DeriveInput = syn::parse(item_tokens)?;
    let name = &input.ident;

    // Impl requires the the generics in particular way.
    let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
    let result = quote! {
        unsafe impl<TS: intercom::type_system::TypeSystem> #impl_generics intercom::type_system::ExternOutput<TS> for #name #ty_generics #where_clause {

            #[inline(always)]
            fn into_foreign_output(self) -> intercom::ComResult<Self::ForeignType> {
                Ok(self)
            }

            #[inline(always)]
            unsafe fn from_foreign_output(source: Self::ForeignType) -> intercom::ComResult<Self> {
                Ok(source)
            }
        }

        unsafe impl<TS: intercom::type_system::TypeSystem> #impl_generics intercom::type_system::InfallibleExternOutput<TS> for #name #ty_generics #where_clause {

            #[inline(always)]
            fn into_foreign_output(self) -> Self::ForeignType {
                self
            }

            #[inline(always)]
            unsafe fn from_foreign_output(source: Self::ForeignType) -> Self {
                source
            }
        }
    };

    Ok(result.into())
}
/// Expands the `ExternOutput` derive attribute.
///
/// The attribute expansion results in the following items:
///
/// - Implementation of the ExternOutput trait.
Expands the `ExternOutput` derive attribute.
The attribute expansion results in the following items.

Implementation of the ExternOutput trait.
Expands the ` ExternOutput ` derive attribute . The attribute expansion results in the following items . Implementation of the ExternOutput trait .
pub fn expand_derive_extern_output(
    item_tokens: TokenStreamNightly,
) -> Result<TokenStreamNightly, syn::Error>
{
    // Get the name of the type we want to implement the trait for.
    let input: syn::DeriveInput = syn::parse(item_tokens)?;
    let name = &input.ident;
    // Impl requires the the generics in particular way.
    let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
    let result = quote! {
        unsafe impl<TS: intercom::type_system::TypeSystem> #impl_generics intercom::type_system::ExternOutput<TS> for #name #ty_generics #where_clause {
            #[inline(always)]
            fn into_foreign_output(self) -> intercom::ComResult<Self::ForeignType> {
                Ok(self)
            }
            #[inline(always)]
            unsafe fn from_foreign_output(source: Self::ForeignType) -> intercom::ComResult<Self> {
                Ok(source)
            }
        }
        unsafe impl<TS: intercom::type_system::TypeSystem> #impl_generics intercom::type_system::InfallibleExternOutput<TS> for #name #ty_generics #where_clause {
            #[inline(always)]
            fn into_foreign_output(self) -> Self::ForeignType {
                self
            }
            #[inline(always)]
            unsafe fn from_foreign_output(source: Self::ForeignType) -> Self {
                source
            }
        }
    };
    Ok(result.into())
}
pub fn expand_derive_extern_output ( item_tokens : TokenStreamNightly , ) -> Result < TokenStreamNightly , syn :: Error > { // Get the name of the type we want to implement the trait for. let input : syn :: DeriveInput = syn :: parse ( item_tokens ) ? ; let name = & input . ident ; // Impl requires the the generics in particular way. let ( impl_generics , ty_generics , where_clause ) = input . generics . split_for_impl ( ) ; let result = quote ! { unsafe impl TS intercom type_system TypeSystem impl_generics intercom type_system ExternOutput TS for name ty_generics where_clause { [ inline ( always ) ] fn into_foreign_output ( self ) intercom ComResult Self ForeignType { Ok ( self ) } [ inline ( always ) ] unsafe fn from_foreign_output ( source Self ForeignType ) intercom ComResult Self { Ok ( source ) } } unsafe impl TS intercom type_system TypeSystem impl_generics intercom type_system InfallibleExternOutput TS for name ty_generics where_clause { [ inline ( always ) ] fn into_foreign_output ( self ) Self ForeignType { self } [ inline ( always ) ] unsafe fn from_foreign_output ( source Self ForeignType ) Self { source } } } ; Ok ( result . into ( ) ) }
Expands the `ExternOutput` derive attribute.
Expands the ` ExternOutput ` derive attribute .
item_tokens
TokenStreamNightly
item_tokens
TokenStreamNightly