pub struct ResponseError {
pub code: i32,
pub message: String,
pub data: Option<Value>,
}Expand description
LSP ResponseError as defined by the JSON-RPC specification. This corresponds to the error object in LSP response messages.
Fields§
§code: i32A number indicating the error type that occurred.
message: StringA string providing a short description of the error.
data: Option<Value>A primitive or structured value that contains additional information about the error.
Implementations§
Source§impl ResponseError
impl ResponseError
Sourcepub fn new(code: i32, message: impl Into<String>) -> Self
pub fn new(code: i32, message: impl Into<String>) -> Self
Create a new ResponseError with the given code and message.
Sourcepub fn with_data(code: i32, message: impl Into<String>, data: Value) -> Self
pub fn with_data(code: i32, message: impl Into<String>, data: Value) -> Self
Create a new ResponseError with additional data.
Sourcepub fn parse_error(message: impl Into<String>) -> Self
pub fn parse_error(message: impl Into<String>) -> Self
Create a parse error.
Sourcepub fn invalid_request(message: impl Into<String>) -> Self
pub fn invalid_request(message: impl Into<String>) -> Self
Create an invalid request error.
Sourcepub fn method_not_found(message: impl Into<String>) -> Self
pub fn method_not_found(message: impl Into<String>) -> Self
Create a method not found error.
Sourcepub fn invalid_params(message: impl Into<String>) -> Self
pub fn invalid_params(message: impl Into<String>) -> Self
Create an invalid params error.
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Create an internal error.
Sourcepub fn server_not_initialized(message: impl Into<String>) -> Self
pub fn server_not_initialized(message: impl Into<String>) -> Self
Create a server not initialized error.
Sourcepub fn request_cancelled(message: impl Into<String>) -> Self
pub fn request_cancelled(message: impl Into<String>) -> Self
Create a request cancelled error.
Sourcepub fn content_modified(message: impl Into<String>) -> Self
pub fn content_modified(message: impl Into<String>) -> Self
Create a content modified error.
Trait Implementations§
Source§impl Clone for ResponseError
impl Clone for ResponseError
Source§fn clone(&self) -> ResponseError
fn clone(&self) -> ResponseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponseError
impl Debug for ResponseError
Source§impl<'de> Deserialize<'de> for ResponseError
impl<'de> Deserialize<'de> for ResponseError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ResponseError
impl Display for ResponseError
Source§impl Error for ResponseError
impl Error for ResponseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ResponseError> for LspError
impl From<ResponseError> for LspError
Source§fn from(source: ResponseError) -> Self
fn from(source: ResponseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ResponseError
impl RefUnwindSafe for ResponseError
impl Send for ResponseError
impl Sync for ResponseError
impl Unpin for ResponseError
impl UnwindSafe for ResponseError
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