twoslash-rust-0.0.3 is not a library.
twoslash-rust
Twoslash backend for Rust code, powered by rust-analyzer. Extracts type information, hover docs, and completions from Rust code.
Installation
Usage
Pipe Rust code to the binary via stdin:
|
Output is JSON with type information:
Use twoslash query markers (// ^?) to extract types at specific positions:
|
Options
--cargo-toml <path>— Use a customCargo.tomlfor dependencies--target-dir <path>— Specify a custom target directory for caching
Server Mode
Set TWOSLASH_SERVER_UUID to run as a persistent TCP server for faster repeated queries:
TWOSLASH_SERVER_UUID=abc123
# Outputs: 127.0.0.1:<port>
Development
Build the binary:
Use --release for development. rust-analyzer is slow at indexing sysroot in debug builds.