pub struct StateSyncLinter { /* private fields */ }Expand description
State synchronization linter
Detects anti-patterns that cause state desync in WASM closures.
§Rules
| Rule | Description | Severity |
|---|---|---|
| WASM-SS-001 | Local Rc::new() in method with closure | Error |
| WASM-SS-002 | Both self.field and local reference exist | Warning |
| WASM-SS-005 | Missing self.*.clone() before closure | Warning |
| WASM-SS-006 | Type alias for Rc<RefCell | Warning |
| WASM-SS-007 | Function returning Rc<RefCell | Warning |
Implementations§
Source§impl StateSyncLinter
impl StateSyncLinter
Sourcepub fn lint_file(&mut self, path: &Path) -> LintResult
pub fn lint_file(&mut self, path: &Path) -> LintResult
Lint a single file
Sourcepub fn lint_source(&mut self, source: &str) -> LintResult
pub fn lint_source(&mut self, source: &str) -> LintResult
Lint source code directly (uses AST-based analysis by default)
This method first attempts AST-based analysis using syn, which is more
accurate and handles edge cases like turbofish syntax. Falls back to
text-based analysis if AST parsing fails.
Sourcepub fn lint_directory(&mut self, dir: &Path) -> LintResult
pub fn lint_directory(&mut self, dir: &Path) -> LintResult
Lint all Rust files in a directory
Trait Implementations§
Source§impl Debug for StateSyncLinter
impl Debug for StateSyncLinter
Auto Trait Implementations§
impl Freeze for StateSyncLinter
impl RefUnwindSafe for StateSyncLinter
impl Send for StateSyncLinter
impl Sync for StateSyncLinter
impl Unpin for StateSyncLinter
impl UnsafeUnpin for StateSyncLinter
impl UnwindSafe for StateSyncLinter
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().