Skip to main content

RustMethError

Enum RustMethError 

Source
pub enum RustMethError {
    Io(Error),
    Json(Error),
    ParseInt(ParseIntError),
    NoContentLength,
    RecvExhausted {
        limit: usize,
    },
    UnexpectedResponseShape(String),
    RustAnalyzerNotFound,
    MissingStdin,
    MissingStdout,
    TypeNotFound {
        type_name: String,
        message: String,
    },
    Timeout {
        type_name: String,
        waited_secs: u64,
    },
    FeatureGated {
        type_name: String,
        message: String,
    },
}
Expand description

The primary error tracking type for operations within the library.

Encapsulates platform errors (I/O, parsing) along with specific failure modes encountered during synchronization or communication with the underlying Language Server Protocol (LSP).

Variants§

§

Io(Error)

Errors originating from direct operating system interaction or file system operations.

§

Json(Error)

Errors resulting from failed JSON serialization or deserialization routines.

§

ParseInt(ParseIntError)

Errors resulting from failed string-to-integer conversions.

§

NoContentLength

Indication that an unexpected byte payload was read from the language server stream due to a missing or improperly formed Content-Length header field.

§

RecvExhausted

Raised when looking for a specific LSP message payload, but the message loop bounds were reached before a match was resolved.

Fields

§limit: usize

The maximum number of distinct messages evaluated before halting the loop.

§

UnexpectedResponseShape(String)

Raised when rust-analyzer returns a payload structurally valid as JSON, but lacking the fields or nested objects required by the expected API model contract.

§

RustAnalyzerNotFound

Indicates that the rust-analyzer executable engine could not be discovered via the host path environment or native component directory.

§

MissingStdin

Indicates that the child process’s stdin handle was not captured, typically because it was not spawned with Stdio::piped().

§

MissingStdout

Indicates that the child process’s stdout handle was not captured, typically because it was not spawned with Stdio::piped().

§

TypeNotFound

Raised when rust-analyzer reports a diagnostic error for the probed type, indicating the type does not exist in scope (e.g. a typo or non-existent type).

Fields

§type_name: String

The type name that was queried.

§message: String

The diagnostic message from rust-analyzer.

§

Timeout

Raised when rust-analyzer fails to produce a usable response within the configured retry budget e.g. a dependency-heavy crate is still being fetched/indexed, or rust-analyzer itself has hung.

Fields

§type_name: String

The name of the type

§waited_secs: u64

How long we waited

§

FeatureGated

Raised when rust-analyzer resolves the path but reports the item was “configured out” i.e. it exists in the crate but requires a Cargo feature flag that wasn’t enabled for the probe. The user should retry with an explicit --deps override enabling the required feature.

Fields

§type_name: String

The name of the type

§message: String

Message stating requirements

Trait Implementations§

Source§

impl Debug for RustMethError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RustMethError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RustMethError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for RustMethError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for RustMethError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ParseIntError> for RustMethError

Source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.