pub struct Progress<B = Unbounded, C = NotCancellable> { /* private fields */ }
Expand description
A builder for a new $/progress
stream.
This progress stream is initially assumed to be unbounded and not cancellable.
This struct is created by Client::progress
. See its documentation for more.
Implementations§
Source§impl<C> Progress<Unbounded, C>
impl<C> Progress<Unbounded, C>
Sourcepub fn with_percentage(self, start_percentage: u32) -> Progress<Bounded, C>
pub fn with_percentage(self, start_percentage: u32) -> Progress<Bounded, C>
Sets the optional progress percentage to display in the client UI.
This percentage value is initially start_percentage
, where a value of 100
for example
is considered 100% by the client. If this method is not called, unbounded progress is
assumed.
Source§impl<B> Progress<B, NotCancellable>
impl<B> Progress<B, NotCancellable>
Indicates that a “cancel” button should be displayed in the client UI.
Clients that don’t support cancellation are allowed to ignore this setting. If this method is not called, the user will not be presented with an option to cancel this operation.
Source§impl<B, C> Progress<B, C>
impl<B, C> Progress<B, C>
Sourcepub fn with_message<M>(self, message: M) -> Self
pub fn with_message<M>(self, message: M) -> Self
Includes 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"
.
Sourcepub async fn begin(self) -> OngoingProgress<B, C>
pub async fn begin(self) -> OngoingProgress<B, C>
Starts reporting progress to the client, returning an OngoingProgress
handle.
§Initialization
This notification will only be sent if the server is initialized.