Struct typify_impl::Type
source · pub struct Type<'a> { /* private fields */ }
Expand description
Representation of a type which may have a definition or may be built-in.
Implementations§
source§impl<'a> Type<'a>
impl<'a> Type<'a>
sourcepub fn ident(&self) -> TokenStream
pub fn ident(&self) -> TokenStream
The identifier for the type as might be used for a function return or defining the type of a member of a struct..
sourcepub fn parameter_ident(&self) -> TokenStream
pub fn parameter_ident(&self) -> TokenStream
The identifier for the type as might be used for a parameter in a
function signature. In general: simple types are the same as
Type::ident and complex types prepend a &
.
sourcepub fn parameter_ident_with_lifetime(&self, lifetime: &str) -> TokenStream
pub fn parameter_ident_with_lifetime(&self, lifetime: &str) -> TokenStream
The identifier for the type as might be used for a parameter in a
function signature along with a lifetime parameter. In general: simple
types are the same as Type::ident and complex types prepend a
&'<lifetime>
.
sourcepub fn describe(&self) -> String
pub fn describe(&self) -> String
A textual description of the type appropriate for debug output.
sourcepub fn details(&self) -> TypeDetails<'_>
pub fn details(&self) -> TypeDetails<'_>
Get details about the type.
sourcepub fn has_impl(&self, impl_name: TypeSpaceImpl) -> bool
pub fn has_impl(&self, impl_name: TypeSpaceImpl) -> bool
Checks if the type has the associated impl.
sourcepub fn builder(&self) -> Option<TokenStream>
pub fn builder(&self) -> Option<TokenStream>
Provides the the type identifier for the builder if one exists.