use crate::types::ProgressToken;
use crate::types::notification::Notification;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProgressNotification {
#[serde(rename = "progressToken")]
pub progress_token: ProgressToken,
pub progress: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
}
impl From<ProgressNotification> for Notification {
#[inline]
fn from(progress: ProgressNotification) -> Self {
Self::new(
super::commands::PROGRESS,
serde_json::to_value(progress).ok(),
)
}
}