Struct subxt_codegen::TypeDefGen
source · pub struct TypeDefGen { /* private fields */ }Expand description
Generates a Rust struct or enum definition based on the supplied [scale-info::Type].
Field type paths are resolved via the TypeGenerator, which contains the registry of all
generated types in the module.
Implementations§
source§impl TypeDefGen
impl TypeDefGen
sourcepub fn from_type(
ty: &Type<PortableForm>,
type_gen: &TypeGenerator<'_>,
crate_path: &CratePath,
should_gen_docs: bool
) -> Result<Self, CodegenError>
pub fn from_type( ty: &Type<PortableForm>, type_gen: &TypeGenerator<'_>, crate_path: &CratePath, should_gen_docs: bool ) -> Result<Self, CodegenError>
Construct a type definition for codegen from the given scale_info::Type.
sourcepub fn has_unused_type_params(&self) -> bool
pub fn has_unused_type_params(&self) -> bool
are there unused type params?
Trait Implementations§
source§impl Debug for TypeDefGen
impl Debug for TypeDefGen
source§impl ToTokens for TypeDefGen
impl ToTokens for TypeDefGen
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 TypeDefGen
impl !Send for TypeDefGen
impl !Sync for TypeDefGen
impl Unpin for TypeDefGen
impl UnwindSafe for TypeDefGen
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.