pub struct OngoingProgress<B, C> { /* private fields */ }Expand description
An ongoing stream of progress being reported to the client.
This struct is created by Progress::begin. See its documentation for more.
Implementations§
Source§impl OngoingProgress<Unbounded, NotCancellable>
impl OngoingProgress<Unbounded, NotCancellable>
Sourcepub async fn report<M>(&self, message: M)
pub async fn report<M>(&self, message: M)
Updates the secondary progress message visible in the client UI.
This message is expected to contain information complementary to the title string passed
into Client::progress, such as "3/25 files", "project/src/module2", or
"node_modules/some_dep".
§Initialization
This notification will only be sent if the server is initialized.
Source§impl OngoingProgress<Unbounded, Cancellable>
impl OngoingProgress<Unbounded, Cancellable>
Sourcepub async fn report(&self, enable_cancel_btn: bool)
pub async fn report(&self, enable_cancel_btn: bool)
Enables or disables the “cancel” button in the client UI.
§Initialization
This notification will only be sent if the server is initialized.
Sourcepub async fn report_with_message<M>(
&self,
message: M,
enable_cancel_btn: Option<bool>,
)
pub async fn report_with_message<M>( &self, message: M, enable_cancel_btn: Option<bool>, )
Updates the secondary progress message visible in the client UI and optionally enables/disables the “cancel” button.
This message is expected to contain information complementary to the title string passed
into Client::progress, such as "3/25 files", "project/src/module2", or
"node_modules/some_dep".
If enable_cancel_btn is None, the state of the “cancel” button in the UI is unchanged.
§Initialization
This notification will only be sent if the server is initialized.
Source§impl OngoingProgress<Bounded, NotCancellable>
impl OngoingProgress<Bounded, NotCancellable>
Sourcepub async fn report(&self, percentage: u32)
pub async fn report(&self, percentage: u32)
Updates the progress percentage displayed in the client UI, where a value of 100 for
example is considered 100% by the client.
§Initialization
This notification will only be sent if the server is initialized.
Sourcepub async fn report_with_message<M>(&self, message: M, percentage: u32)
pub async fn report_with_message<M>(&self, message: M, percentage: u32)
Same as OngoingProgress::report, except it also
displays an optional more detailed progress message.
This message is expected to contain information complementary to the title string passed
into Client::progress, such as "3/25 files", "project/src/module2", or
"node_modules/some_dep".
§Initialization
This notification will only be sent if the server is initialized.
Source§impl OngoingProgress<Bounded, Cancellable>
impl OngoingProgress<Bounded, Cancellable>
Sourcepub async fn report(&self, percentage: u32, enable_cancel_btn: Option<bool>)
pub async fn report(&self, percentage: u32, enable_cancel_btn: Option<bool>)
Updates the progress percentage displayed in the client UI, where a value of 100 for
example is considered 100% by the client.
If enable_cancel_btn is None, the state of the “cancel” button in the UI is unchanged.
§Initialization
This notification will only be sent if the server is initialized.
Sourcepub async fn report_with_message<M>(
&self,
message: M,
percentage: u32,
enable_cancel_btn: Option<bool>,
)
pub async fn report_with_message<M>( &self, message: M, percentage: u32, enable_cancel_btn: Option<bool>, )
Same as OngoingProgress::report, except it also
displays an optional more detailed progress message.
This message is expected to contain information complementary to the title string passed
into Client::progress, such as "3/25 files", "project/src/module2", or
"node_modules/some_dep".
§Initialization
This notification will only be sent if the server is initialized.
Source§impl<C> OngoingProgress<Bounded, C>
impl<C> OngoingProgress<Bounded, C>
Sourcepub fn into_unbounded(self) -> OngoingProgress<Unbounded, C>
pub fn into_unbounded(self) -> OngoingProgress<Unbounded, C>
Discards the progress bound associated with this OngoingProgress.
All subsequent progress reports will no longer show a percentage value.
Source§impl<B, C> OngoingProgress<B, C>
impl<B, C> OngoingProgress<B, C>
Sourcepub async fn finish(self)
pub async fn finish(self)
Indicates this long-running operation is complete.
§Initialization
This notification will only be sent if the server is initialized.
Sourcepub async fn finish_with_message<M>(self, message: M)
pub async fn finish_with_message<M>(self, message: M)
Same as OngoingProgress::finish, except it also displays an optional more detailed
progress message.
This message is expected to contain information complementary to the title string passed
into Client::progress, such as "3/25 files", "project/src/module2", or
"node_modules/some_dep".
§Initialization
This notification will only be sent if the server is initialized.
Sourcepub const fn token(&self) -> &ProgressToken
pub const fn token(&self) -> &ProgressToken
Returns the ProgressToken associated with this long-running operation.