pub enum CodegenTypeName<'a> {
Schema(&'a SchemaIrTypeView<'a>),
Inline(&'a InlineIrTypeView<'a>),
}Expand description
A name for a schema or an inline type, used in generated Rust code.
CodegenTypeName is the high-level representation of a type name.
For emitting arbitrary identifiers, like fields, parameters, and methods,
use CodegenIdent and CodegenIdentUsage instead.
CodegenTypeName implements ToTokens to produce PascalCase identifiers
(e.g., Pet, GetItemsFilter) in quote macros.
Use into_module_name for the corresponding module name,
and into_sort_key for deterministic sorting.
Variants§
Schema(&'a SchemaIrTypeView<'a>)
Inline(&'a InlineIrTypeView<'a>)
Implementations§
Source§impl<'a> CodegenTypeName<'a>
impl<'a> CodegenTypeName<'a>
pub fn into_module_name(self) -> CodegenModuleName<'a>
pub fn into_sort_key(self) -> CodegenTypeNameSortKey<'a>
Trait Implementations§
Source§impl<'a> Clone for CodegenTypeName<'a>
impl<'a> Clone for CodegenTypeName<'a>
Source§fn clone(&self) -> CodegenTypeName<'a>
fn clone(&self) -> CodegenTypeName<'a>
Returns a duplicate 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<'a> Debug for CodegenTypeName<'a>
impl<'a> Debug for CodegenTypeName<'a>
Source§impl ToTokens for CodegenTypeName<'_>
impl ToTokens for CodegenTypeName<'_>
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,
impl<'a> Copy for CodegenTypeName<'a>
Auto Trait Implementations§
impl<'a> Freeze for CodegenTypeName<'a>
impl<'a> !RefUnwindSafe for CodegenTypeName<'a>
impl<'a> Send for CodegenTypeName<'a>
impl<'a> Sync for CodegenTypeName<'a>
impl<'a> Unpin for CodegenTypeName<'a>
impl<'a> !UnwindSafe for CodegenTypeName<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.