Struct telety_impl::alias::Alias
source · pub struct Alias<'m> { /* private fields */ }Expand description
The details of a type alias.
Implementations§
source§impl<'m> Alias<'m>
impl<'m> Alias<'m>
sourcepub fn is_generic_parameter_type(&self) -> bool
pub fn is_generic_parameter_type(&self) -> bool
Is this alias for a type parameter?
Only lone type parameters are included (i.e. T, but not Vec<T>).
sourcepub fn parameters(&self) -> &Generics
pub fn parameters(&self) -> &Generics
The generic parameters required for this type alias.
For example, this item has two type parameters:
ⓘ
struct Either<A, B> {
A(Box<A>),
B(Box<B>),
}But reusing these parameters on the alias to the type in variant A will fail,
as parameter B is unused by the aliased type:
ⓘ
type Alias<A, B> = Box<A>;type parameter `B` is unused
This method returns only the generic parameters used by the alias.
sourcepub fn path_segment_no_generics(&self) -> PathSegment
pub fn path_segment_no_generics(&self) -> PathSegment
Returns this alias formatted as a PathSegment, without generic parameters
sourcepub fn path_segment(&self) -> PathSegment
pub fn path_segment(&self) -> PathSegment
Returns this alias formatted as a PathSegment, with unsubstituted generic arguments if applicable.
sourcepub fn aliased_type(&self) -> &Type
pub fn aliased_type(&self) -> &Type
The original type being aliased
sourcepub fn aliased_type_arguments(
&self
) -> Option<&Punctuated<GenericArgument, Comma>>
pub fn aliased_type_arguments( &self ) -> Option<&Punctuated<GenericArgument, Comma>>
The type arguments on the original aliased type.
e.g. i32, u64 for my_crate::MyType<i32, i64>
Trait Implementations§
impl<'m> Copy for Alias<'m>
Auto Trait Implementations§
impl<'m> Freeze for Alias<'m>
impl<'m> RefUnwindSafe for Alias<'m>
impl<'m> !Send for Alias<'m>
impl<'m> !Sync for Alias<'m>
impl<'m> Unpin for Alias<'m>
impl<'m> UnwindSafe for Alias<'m>
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