pub struct RustAnalyzerClient { /* private fields */ }Implementations§
Source§impl RustAnalyzerClient
impl RustAnalyzerClient
pub fn new(workspace_root: PathBuf) -> Self
pub async fn start(&mut self) -> Result<()>
pub async fn open_document(&mut self, uri: &str, content: &str) -> Result<()>
Sourcepub async fn shutdown(&mut self) -> Result<()>
pub async fn shutdown(&mut self) -> Result<()>
Shuts rust-analyzer down, attempting the graceful LSP handshake first.
Sourcepub async fn force_kill(&mut self)
pub async fn force_kill(&mut self)
Kills rust-analyzer immediately, without the LSP shutdown handshake.
Meant for when a graceful Self::shutdown was aborted, so the process must not be left
behind.
Sourcepub fn is_gone(&self) -> bool
pub fn is_gone(&self) -> bool
Whether rust-analyzer is gone, i.e. its stdout has closed because it exited or is about to.
Sourcepub fn exit_status(&mut self) -> Option<ExitStatus>
pub fn exit_status(&mut self) -> Option<ExitStatus>
The exit status of the rust-analyzer process, if it has exited.
Source§impl RustAnalyzerClient
impl RustAnalyzerClient
pub async fn hover( &mut self, uri: &str, line: u32, character: u32, ) -> Result<Value>
pub async fn definition( &mut self, uri: &str, line: u32, character: u32, ) -> Result<Value>
pub async fn references( &mut self, uri: &str, line: u32, character: u32, ) -> Result<Value>
pub async fn completion( &mut self, uri: &str, line: u32, character: u32, ) -> Result<Value>
pub async fn document_symbols(&mut self, uri: &str) -> Result<Value>
pub async fn formatting(&mut self, uri: &str) -> Result<Value>
pub async fn diagnostics(&mut self, uri: &str) -> Result<Value>
pub async fn workspace_diagnostics(&mut self) -> Result<Value>
pub async fn code_actions( &mut self, uri: &str, start_line: u32, start_char: u32, end_line: u32, end_char: u32, ) -> Result<Value>
Auto Trait Implementations§
impl !RefUnwindSafe for RustAnalyzerClient
impl !UnwindSafe for RustAnalyzerClient
impl Freeze for RustAnalyzerClient
impl Send for RustAnalyzerClient
impl Sync for RustAnalyzerClient
impl Unpin for RustAnalyzerClient
impl UnsafeUnpin for RustAnalyzerClient
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 more