Struct OngoingProgress

Source
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>

Source

pub async fn report<M>(&self, message: M)
where M: Into<String>,

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>

Source

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.

Source

pub async fn report_with_message<M>( &self, message: M, enable_cancel_btn: Option<bool>, )
where M: Into<String>,

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>

Source

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.

Source

pub async fn report_with_message<M>(&self, message: M, percentage: u32)
where M: Into<String>,

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>

Source

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.

Source

pub async fn report_with_message<M>( &self, message: M, percentage: u32, enable_cancel_btn: Option<bool>, )
where M: Into<String>,

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>

Source

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>

Source

pub async fn finish(self)

Indicates this long-running operation is complete.

§Initialization

This notification will only be sent if the server is initialized.

Source

pub async fn finish_with_message<M>(self, message: M)
where M: Into<String>,

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.

Source

pub const fn token(&self) -> &ProgressToken

Returns the ProgressToken associated with this long-running operation.

Trait Implementations§

Source§

impl<B, C> Debug for OngoingProgress<B, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B, C> Freeze for OngoingProgress<B, C>

§

impl<B, C> !RefUnwindSafe for OngoingProgress<B, C>

§

impl<B, C> Send for OngoingProgress<B, C>
where B: Send, C: Send,

§

impl<B, C> Sync for OngoingProgress<B, C>
where B: Sync, C: Sync,

§

impl<B, C> Unpin for OngoingProgress<B, C>
where B: Unpin, C: Unpin,

§

impl<B, C> !UnwindSafe for OngoingProgress<B, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more