pub struct Generic {
pub name: EcoString,
pub span: Span,
/* private fields */
}Fields§
§name: EcoString§span: SpanImplementations§
Source§impl Generic
impl Generic
pub fn new( name: impl Into<EcoString>, bounds: Vec<Annotation>, span: Span, ) -> Self
Sourcepub fn resolved(
name: impl Into<EcoString>,
bounds: impl IntoIterator<Item = (Annotation, Type)>,
span: Span,
) -> Self
pub fn resolved( name: impl Into<EcoString>, bounds: impl IntoIterator<Item = (Annotation, Type)>, span: Span, ) -> Self
Constructs a generic whose bound annotations have already been resolved.
This is primarily used when restoring semantic data from a cache: the annotation remains available for diagnostics and emission, while the resolved type remains the canonical semantic meaning of the bound.
pub fn bounds(&self) -> impl Iterator<Item = &Annotation> + Clone
pub fn bound_count(&self) -> usize
pub fn bounds_are_resolved(&self) -> bool
pub fn resolved_bounds(&self) -> Option<impl Iterator<Item = &Type> + Clone>
pub fn for_each_bound_annotation_mut( &mut self, visit: impl FnMut(&mut Annotation), )
pub fn resolve_bounds_with(&mut self, resolve: impl FnMut(&Annotation) -> Type)
Trait Implementations§
impl StructuralPartialEq for Generic
Auto Trait Implementations§
impl Forget for Generic
impl Freeze for Genericwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Annotation>: Freeze,
PhantomData<ResolvedGenericBound>: Freeze,
impl Move for Generic
impl RefUnwindSafe for Generic
impl Send for Generic
impl Sync for Generic
impl Unpin for Generic
impl UnsafeUnpin for Genericwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Annotation>: UnsafeUnpin,
PhantomData<ResolvedGenericBound>: UnsafeUnpin,
impl UnwindSafe for Genericwhere
NonNull<u8>: UnwindSafe,
RawVecInner: UnwindSafe,
BoxRaw<Annotation>: UnwindSafe,
Arc<Box<[Type]>>: UnwindSafe,
Arc<FunctionType>: UnwindSafe,
BoxRaw<Type>: UnwindSafe,
Arc<Spelling>: UnwindSafe,
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