pub struct Checker { /* private fields */ }Expand description
Reusable checker instance with persistent global definitions.
Checker is Send but not Sync. The underlying Luau Analysis structures
are safely movable between threads, but all operations that mutate or read
from the checker require exclusive &mut self access, meaning it cannot
be concurrently accessed from multiple threads.
Implementations§
Source§impl Checker
impl Checker
Sourcepub fn with_options(options: CheckerOptions) -> Result<Self, Error>
pub fn with_options(options: CheckerOptions) -> Result<Self, Error>
Creates a checker with explicit defaults.
Sourcepub fn options(&self) -> &CheckerOptions
pub fn options(&self) -> &CheckerOptions
Returns immutable access to default checker options.
Sourcepub fn add_definitions(&mut self, defs: &str) -> Result<(), Error>
pub fn add_definitions(&mut self, defs: &str) -> Result<(), Error>
Loads Luau definition source using default module label.
Sourcepub fn add_definitions_with_name(
&mut self,
defs: &str,
module_name: &str,
) -> Result<(), Error>
pub fn add_definitions_with_name( &mut self, defs: &str, module_name: &str, ) -> Result<(), Error>
Loads Luau definition source with an explicit module label.
Sourcepub fn check(&mut self, source: &str) -> Result<CheckResult, Error>
pub fn check(&mut self, source: &str) -> Result<CheckResult, Error>
Type-checks a Luau source module with default options.
Sourcepub fn check_with_options(
&mut self,
source: &str,
options: CheckOptions<'_>,
) -> Result<CheckResult, Error>
pub fn check_with_options( &mut self, source: &str, options: CheckOptions<'_>, ) -> Result<CheckResult, Error>
Type-checks a Luau source module with explicit per-call options.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Checker
impl RefUnwindSafe for Checker
impl !Sync for Checker
impl Unpin for Checker
impl UnsafeUnpin for Checker
impl UnwindSafe for Checker
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