pub struct ProgressUpdate {
pub token: ProgressToken,
pub progress: f64,
pub total: Option<f64>,
pub message: Option<Cow<'static, str>>,
}Expand description
One progress update to put on the wire.
Fields§
§token: ProgressTokenThe token the request carried.
progress: f64How far along it is. Increases monotonically.
total: Option<f64>How far along it has to be, when the handler knows.
message: Option<Cow<'static, str>>An optional description of the current step.
Implementations§
Source§impl ProgressUpdate
impl ProgressUpdate
Sourcepub const fn new(token: ProgressToken, progress: f64) -> Self
pub const fn new(token: ProgressToken, progress: f64) -> Self
An update with a progress value and nothing else.
Sourcepub const fn with_total(self, total: f64) -> Self
pub const fn with_total(self, total: f64) -> Self
Sets the total.
Sourcepub fn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
pub fn with_message(self, message: impl Into<Cow<'static, str>>) -> Self
Sets the message.
Trait Implementations§
Source§impl Clone for ProgressUpdate
impl Clone for ProgressUpdate
Source§impl Debug for ProgressUpdate
impl Debug for ProgressUpdate
Source§impl PartialEq for ProgressUpdate
impl PartialEq for ProgressUpdate
impl StructuralPartialEq for ProgressUpdate
Auto Trait Implementations§
impl Freeze for ProgressUpdate
impl RefUnwindSafe for ProgressUpdate
impl Send for ProgressUpdate
impl Sync for ProgressUpdate
impl Unpin for ProgressUpdate
impl UnsafeUnpin for ProgressUpdate
impl UnwindSafe for ProgressUpdate
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