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)
pub fn retain_bounds(&mut self, keep: impl FnMut(&Annotation) -> bool)
Trait Implementations§
impl StructuralPartialEq for Generic
Auto Trait Implementations§
impl Freeze for Generic
impl RefUnwindSafe for Generic
impl Send for Generic
impl Sync for Generic
impl Unpin for Generic
impl UnsafeUnpin for Generic
impl UnwindSafe for Generic
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