#[non_exhaustive]pub struct ProgressNotification {
pub progress_token: ProgressToken,
pub progress: f64,
pub total: Option<f64>,
pub message: Option<String>,
}Expand description
Progress notification.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.progress_token: ProgressTokenProgress token from the original request
progress: f64Current progress value (must increase with each notification)
This can represent percentage (0-100), count, or any increasing metric.
total: Option<f64>Optional total value for the operation
When combined with progress, allows expressing “5 of 10 items processed”.
Both progress and total may be floating point values.
message: Option<String>Optional human-readable progress message
Should provide relevant context about the current operation.
Implementations§
Source§impl ProgressNotification
impl ProgressNotification
Sourcepub fn new(
progress_token: ProgressToken,
progress: f64,
message: Option<String>,
) -> Self
pub fn new( progress_token: ProgressToken, progress: f64, message: Option<String>, ) -> Self
Create a new progress notification with no total value.
Convenience constructor to reduce boilerplate when the total is unknown.
Sourcepub fn with_total(self, total: f64) -> Self
pub fn with_total(self, total: f64) -> Self
Set the total value for the operation.
Trait Implementations§
Source§impl Clone for ProgressNotification
impl Clone for ProgressNotification
Source§fn clone(&self) -> ProgressNotification
fn clone(&self) -> ProgressNotification
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProgressNotification
impl Debug for ProgressNotification
Source§impl<'de> Deserialize<'de> for ProgressNotification
impl<'de> Deserialize<'de> for ProgressNotification
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
Auto Trait Implementations§
impl Freeze for ProgressNotification
impl RefUnwindSafe for ProgressNotification
impl Send for ProgressNotification
impl Sync for ProgressNotification
impl Unpin for ProgressNotification
impl UnsafeUnpin for ProgressNotification
impl UnwindSafe for ProgressNotification
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