Struct subxt_codegen::TypeDefParameters
source · pub struct TypeDefParameters { /* private fields */ }Expand description
Represents the set of generic type parameters for generating a type definition e.g. the T in
Foo<T>.
Additionally this allows generating a PhantomData type for any type params which are unused
in the type definition itself.
Implementations§
source§impl TypeDefParameters
impl TypeDefParameters
sourcepub fn new(params: Vec<TypeParameter>) -> Self
pub fn new(params: Vec<TypeParameter>) -> Self
Create a new TypeDefParameters instance.
sourcepub fn update_unused<'a>(
&mut self,
fields: impl Iterator<Item = &'a CompositeDefFieldType>
)
pub fn update_unused<'a>( &mut self, fields: impl Iterator<Item = &'a CompositeDefFieldType> )
Update the set of unused type parameters by removing those that are used in the given fields.
sourcepub fn unused_params_phantom_data(&self) -> Option<TypePath>
pub fn unused_params_phantom_data(&self) -> Option<TypePath>
Construct a core::marker::PhantomData for the type unused type params.
sourcepub fn has_unused_type_params(&self) -> bool
pub fn has_unused_type_params(&self) -> bool
Returns true if there are any unused type params
Trait Implementations§
source§impl Clone for TypeDefParameters
impl Clone for TypeDefParameters
source§fn clone(&self) -> TypeDefParameters
fn clone(&self) -> TypeDefParameters
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TypeDefParameters
impl Debug for TypeDefParameters
source§impl Default for TypeDefParameters
impl Default for TypeDefParameters
source§fn default() -> TypeDefParameters
fn default() -> TypeDefParameters
Returns the “default value” for a type. Read more
source§impl ToTokens for TypeDefParameters
impl ToTokens for TypeDefParameters
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,
Auto Trait Implementations§
impl RefUnwindSafe for TypeDefParameters
impl !Send for TypeDefParameters
impl !Sync for TypeDefParameters
impl Unpin for TypeDefParameters
impl UnwindSafe for TypeDefParameters
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.