Struct lsp_async_stub::rpc::Response
source · [−]pub struct Response<R = ()> {
pub jsonrpc: String,
pub id: RequestId,
pub result: Option<R>,
pub error: Option<Error>,
}
Fields
jsonrpc: String
id: RequestId
result: Option<R>
error: Option<Error>
Implementations
sourceimpl<R> Response<R>
impl<R> Response<R>
pub fn with_request_id(self, id: RequestId) -> Self
sourceimpl<R: Serialize + DeserializeOwned> Response<R>
impl<R: Serialize + DeserializeOwned> Response<R>
pub fn success(data: R) -> Self
pub fn into_result(self) -> Result<R, Error>
pub fn into_message(self) -> Message
sourceimpl Response<Value>
impl Response<Value>
pub fn into_params<P: DeserializeOwned>(self) -> Response<P>
Trait Implementations
sourceimpl<'de, R> Deserialize<'de> for Response<R> where
R: Deserialize<'de>,
impl<'de, R> Deserialize<'de> for Response<R> where
R: Deserialize<'de>,
sourcefn 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
sourceimpl<E, R> From<Result<R, E>> for Response<R> where
R: Serialize + for<'r> Deserialize<'r>,
E: Into<Error>,
impl<E, R> From<Result<R, E>> for Response<R> where
R: Serialize + for<'r> Deserialize<'r>,
E: Into<Error>,
impl<R: Eq> Eq for Response<R>
impl<R> StructuralEq for Response<R>
impl<R> StructuralPartialEq for Response<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for Response<R> where
R: RefUnwindSafe,
impl<R> Send for Response<R> where
R: Send,
impl<R> Sync for Response<R> where
R: Sync,
impl<R> Unpin for Response<R> where
R: Unpin,
impl<R> UnwindSafe for Response<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more