pub struct TypeChecker { /* private fields */ }Implementations§
Source§impl TypeChecker
impl TypeChecker
pub fn new() -> Self
Sourcepub fn with_source(self, source: String) -> Self
pub fn with_source(self, source: String) -> Self
Set source code for error reporting
Sourcepub fn with_filename(self, filename: String) -> Self
pub fn with_filename(self, filename: String) -> Self
Set filename for error reporting
Sourcepub fn with_known_bindings(self, names: &[String]) -> Self
pub fn with_known_bindings(self, names: &[String]) -> Self
Register host-provided root-scope bindings (e.g. extension module namespaces).
pub fn with_analysis_mode(self, mode: TypeAnalysisMode) -> Self
Sourcepub fn check_program(
&mut self,
program: &Program,
) -> Result<TypeCheckResult, Vec<TypeErrorWithLocation>>
pub fn check_program( &mut self, program: &Program, ) -> Result<TypeCheckResult, Vec<TypeErrorWithLocation>>
Type check a complete program
Sourcepub fn errors(&self) -> &[TypeErrorWithLocation]
pub fn errors(&self) -> &[TypeErrorWithLocation]
Get all collected errors
Sourcepub fn format_errors(&self) -> String
pub fn format_errors(&self) -> String
Format all errors for display
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeChecker
impl RefUnwindSafe for TypeChecker
impl Send for TypeChecker
impl Sync for TypeChecker
impl Unpin for TypeChecker
impl UnsafeUnpin for TypeChecker
impl UnwindSafe for TypeChecker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more