pub fn to_tokens_with_crate_name(&self, dialectic_crate: &Path, tokens: &mut TokenStream) {
        use Target::*;

        // We assign the associated span of the target to any type tokens generated, in an attempt
        // to get at least some type errors/issues to show up in the right place.
        let span = self.span;

        match &self.inner {
            Done => quote_spanned! {span=> #dialectic_crate::types::Done }.to_tokens(tokens),
            Recv(t, s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Recv<#t, #s>).to_tokens(tokens);
            }
            Send(t, s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Send<#t, #s>).to_tokens(tokens);
            }
            Loop(s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Loop<#s>).to_tokens(tokens);
            }
            Split {
                tx_only: s,
                rx_only: p,
                cont: q,
            } => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                let q = q.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Split<#s, #p, #q>).to_tokens(tokens);
            }
            Call(s, p) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Call<#s, #p>).to_tokens(tokens);
            }
            Then(s, p) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> <#s as #dialectic_crate::types::Then<#p>>::Combined)
                    .to_tokens(tokens);
            }
            Choose(cs) => {
                let cs = cs
                    .iter()
                    .map(|c| c.to_token_stream_with_crate_name(dialectic_crate));
                quote_spanned!(span=> #dialectic_crate::types::Choose<(#(#cs,)*)>).to_tokens(tokens)
            }
            Offer(cs) => {
                let cs = cs
                    .iter()
                    .map(|c| c.to_token_stream_with_crate_name(dialectic_crate));
                quote_spanned!(span=> #dialectic_crate::types::Offer<(#(#cs,)*)>).to_tokens(tokens)
            }
            Continue(n) => {
                quote_spanned!(span=> #dialectic_crate::types::Continue<#n>).to_tokens(tokens)
            }
            Type(s) => quote_spanned!(span=> #s).to_tokens(tokens),
        }
    }
/// Convert this `Spanned<Target>` into tokens and append them to the provided `TokenStream`
/// using a provided crate name when referencing types from dialectic.
Convert this `Spanned` into tokens and append them to the provided `TokenStream`
using a provided crate name when referencing types from dialectic.
Convert this ` Spanned ` into tokens and append them to the provided ` TokenStream ` using a provided crate name when referencing types from dialectic .
pub fn to_tokens_with_crate_name(&self, dialectic_crate: &Path, tokens: &mut TokenStream) {
        use Target::*;
        // We assign the associated span of the target to any type tokens generated, in an attempt
        // to get at least some type errors/issues to show up in the right place.
        let span = self.span;
        match &self.inner {
            Done => quote_spanned! {span=> #dialectic_crate::types::Done }.to_tokens(tokens),
            Recv(t, s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Recv<#t, #s>).to_tokens(tokens);
            }
            Send(t, s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Send<#t, #s>).to_tokens(tokens);
            }
            Loop(s) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Loop<#s>).to_tokens(tokens);
            }
            Split {
                tx_only: s,
                rx_only: p,
                cont: q,
            } => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                let q = q.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Split<#s, #p, #q>).to_tokens(tokens);
            }
            Call(s, p) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> #dialectic_crate::types::Call<#s, #p>).to_tokens(tokens);
            }
            Then(s, p) => {
                let s = s.to_token_stream_with_crate_name(dialectic_crate);
                let p = p.to_token_stream_with_crate_name(dialectic_crate);
                quote_spanned!(span=> <#s as #dialectic_crate::types::Then<#p>>::Combined)
                    .to_tokens(tokens);
            }
            Choose(cs) => {
                let cs = cs
                    .iter()
                    .map(|c| c.to_token_stream_with_crate_name(dialectic_crate));
                quote_spanned!(span=> #dialectic_crate::types::Choose<(#(#cs,)*)>).to_tokens(tokens)
            }
            Offer(cs) => {
                let cs = cs
                    .iter()
                    .map(|c| c.to_token_stream_with_crate_name(dialectic_crate));
                quote_spanned!(span=> #dialectic_crate::types::Offer<(#(#cs,)*)>).to_tokens(tokens)
            }
            Continue(n) => {
                quote_spanned!(span=> #dialectic_crate::types::Continue<#n>).to_tokens(tokens)
            }
            Type(s) => quote_spanned!(span=> #s).to_tokens(tokens),
        }
    }
pub fn to_tokens_with_crate_name ( & self , dialectic_crate : & Path , tokens : & mut TokenStream ) { use Target :: * ; // We assign the associated span of the target to any type tokens generated, in an attempt // to get at least some type errors/issues to show up in the right place. let span = self . span ; match & self . inner { Done => quote_spanned ! { span dialectic_crate types Done } . to_tokens ( tokens ) , Recv ( t , s ) => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span dialectic_crate types Recv t s ) . to_tokens ( tokens ) ; } Send ( t , s ) => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span dialectic_crate types Send t s ) . to_tokens ( tokens ) ; } Loop ( s ) => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span dialectic_crate types Loop s ) . to_tokens ( tokens ) ; } Split { tx_only : s , rx_only : p , cont : q , } => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; let p = p . to_token_stream_with_crate_name ( dialectic_crate ) ; let q = q . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span dialectic_crate types Split s p q ) . to_tokens ( tokens ) ; } Call ( s , p ) => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; let p = p . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span dialectic_crate types Call s p ) . to_tokens ( tokens ) ; } Then ( s , p ) => { let s = s . to_token_stream_with_crate_name ( dialectic_crate ) ; let p = p . to_token_stream_with_crate_name ( dialectic_crate ) ; quote_spanned ! ( span s as dialectic_crate types Then p Combined ) . to_tokens ( tokens ) ; } Choose ( cs ) => { let cs = cs . iter ( ) . map ( | c | c . to_token_stream_with_crate_name ( dialectic_crate ) ) ; quote_spanned ! ( span dialectic_crate types Choose ( ( cs ) ) ) . to_tokens ( tokens ) } Offer ( cs ) => { let cs = cs . iter ( ) . map ( | c | c . to_token_stream_with_crate_name ( dialectic_crate ) ) ; quote_spanned ! ( span dialectic_crate types Offer ( ( cs ) ) ) . to_tokens ( tokens ) } Continue ( n ) => { quote_spanned ! ( span dialectic_crate types Continue n ) . to_tokens ( tokens ) } Type ( s ) => quote_spanned ! ( span s ) . to_tokens ( tokens ) , } }
Convert this `Spanned<Target>` into tokens and append them to the provided `TokenStream`
using a provided crate name when referencing types from dialectic.
Convert this ` Spanned<Target > ` into tokens and append them to the provided ` TokenStream ` using a provided crate name when referencing types from dialectic .
&self
dialectic_crate
&Path
tokens
&mut TokenStream