pub struct Notification {
pub method: String,
pub params: Value,
}
Expand description
A notification in the Language Server Protocol.
Fields§
§method: String
The method identifier of the notification.
params: Value
The parameters of the notification.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn new(method: String, params: impl Serialize) -> Notification
pub fn new(method: String, params: impl Serialize) -> Notification
Creates a new notification.
Sourcepub fn extract<P: DeserializeOwned>(
self,
method: &str,
) -> Result<P, ExtractError<Notification>>
pub fn extract<P: DeserializeOwned>( self, method: &str, ) -> Result<P, ExtractError<Notification>>
Extracts the typed parameters of the a notification accordingly.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
Returns a copy 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 Notification
impl Debug for Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
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 From<Notification> for Message
impl From<Notification> for Message
Source§fn from(notification: Notification) -> Message
fn from(notification: Notification) -> Message
Converts to this type from the input type.
Source§impl From<Notification> for Message
impl From<Notification> for Message
Source§fn from(notification: Notification) -> Message
fn from(notification: Notification) -> Message
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnwindSafe for Notification
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