pub struct TypeInferenceEngine { /* private fields */ }Expand description
Main type inference engine
Implementations§
Source§impl TypeInferenceEngine
impl TypeInferenceEngine
Sourcepub fn new() -> TypeInferenceEngine
pub fn new() -> TypeInferenceEngine
Creates a new type inference engine with built-in function signatures
Sourcepub fn infer(&mut self, ast: &Node) -> Result<PerlType, Vec<TypeConstraint>>
pub fn infer(&mut self, ast: &Node) -> Result<PerlType, Vec<TypeConstraint>>
Infer types for an AST
Sourcepub fn get_type_at(&self, name: &str) -> Option<PerlType>
pub fn get_type_at(&self, name: &str) -> Option<PerlType>
Gets the inferred type for a variable by name
Sourcepub fn hover_label_for(&self, name: &str) -> Option<String>
pub fn hover_label_for(&self, name: &str) -> Option<String>
Returns a human-readable type label for use in hover text.
Returns None if the variable has not been tracked by the engine.
Sourcepub fn get_subroutine(&self, name: &str) -> Option<PerlType>
pub fn get_subroutine(&self, name: &str) -> Option<PerlType>
Gets the inferred type signature for a subroutine
Sourcepub fn get_type_errors(&self) -> Vec<TypeConstraint>
pub fn get_type_errors(&self) -> Vec<TypeConstraint>
Returns all type constraint violations as errors
Trait Implementations§
Source§impl Default for TypeInferenceEngine
impl Default for TypeInferenceEngine
Source§fn default() -> TypeInferenceEngine
fn default() -> TypeInferenceEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeInferenceEngine
impl RefUnwindSafe for TypeInferenceEngine
impl Send for TypeInferenceEngine
impl Sync for TypeInferenceEngine
impl Unpin for TypeInferenceEngine
impl UnsafeUnpin for TypeInferenceEngine
impl UnwindSafe for TypeInferenceEngine
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