pub struct TsserverProcess { /* private fields */ }Expand description
Represents an owned tsserver instance (syntax or semantic).
Implementations§
Source§impl TsserverProcess
impl TsserverProcess
pub fn new( kind: ServerKind, binary: TsserverBinary, launch: TsserverLaunchOptions, ) -> Self
Sourcepub fn start(&mut self) -> Result<(), ProcessError>
pub fn start(&mut self) -> Result<(), ProcessError>
Spawns the tsserver child process and starts the reader thread.
Sourcepub fn write(&mut self, payload: &Value) -> Result<(), ProcessError>
pub fn write(&mut self, payload: &Value) -> Result<(), ProcessError>
Sends a JSON payload to tsserver using the newline-delimited framing that
tsserver --stdio expects (it only emits Content-Length headers).
Sourcepub fn cancel(&self, seq: u64) -> Result<(), ProcessError>
pub fn cancel(&self, seq: u64) -> Result<(), ProcessError>
Signals cancellation by touching seq_{id} inside the cancellation pipe directory.
pub fn response_rx(&self) -> Option<Receiver<Value>>
pub fn pid(&self) -> Option<u32>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TsserverProcess
impl !RefUnwindSafe for TsserverProcess
impl Send for TsserverProcess
impl Sync for TsserverProcess
impl Unpin for TsserverProcess
impl !UnwindSafe for TsserverProcess
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