pub struct ProgressParams {
pub channel: Uri,
pub progress_token: String,
pub progress: i64,
pub total: Option<i64>,
pub message: Option<String>,
}Expand description
Generic progress notification for a long-running operation.
A client opts in to progress for a request by including a progressToken in
that request (today: the progressToken field on createSession). If the
server does long-running work to service the request — e.g. lazily
downloading an agent’s native SDK the first time a session of that provider
is materialized — it emits progress notifications carrying the same token.
The notification is operation-agnostic: it says nothing about what is
progressing. The client correlates progressToken back to the request it
originated from (and thus the UI surface awaiting it) and renders its own
localized indicator. The same channel serves any future long-running
operation without a new method.
Semantics:
progressis monotonically non-decreasing for a givenprogressToken.totalis present only when the server knows the magnitude up front (e.g. aContent-Length); when absent the client SHOULD show an indeterminate indicator.- The operation is complete when
progress === total. The server MUST emit a final frame satisfyingprogress === total; when the total was never known, it setstotalto the finalprogresson that frame. No further frames reference the token afterwards. - The server MAY emit no progress at all (e.g. the work was already done); the client then never shows an indicator.
- Like all notifications this is ephemeral and is not replayed on reconnect. A client that never receives the terminal frame SHOULD expire the indicator after an idle timeout.
Fields§
§channel: UriChannel URI this notification belongs to (the root channel).
progress_token: StringEchoes the progressToken the client supplied on the originating request
(e.g. the progressToken field of createSession), correlating this frame
to that call. Unique across the client’s active requests.
progress: i64Progress so far, in operation-defined units (e.g. bytes received).
Monotonically non-decreasing for a given progressToken.
total: Option<i64>Total when known up front (e.g. from a Content-Length); omitted ⇒
indeterminate. The operation is complete once progress === total.
message: Option<String>Optional human-readable progress message. The client owns its own (localized) presentation derived from the originating request; generic clients that don’t track the token MAY display this instead.
Trait Implementations§
Source§impl Clone for ProgressParams
impl Clone for ProgressParams
Source§fn clone(&self) -> ProgressParams
fn clone(&self) -> ProgressParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProgressParams
impl Debug for ProgressParams
Source§impl<'de> Deserialize<'de> for ProgressParams
impl<'de> Deserialize<'de> for ProgressParams
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>,
Source§impl PartialEq for ProgressParams
impl PartialEq for ProgressParams
Source§fn eq(&self, other: &ProgressParams) -> bool
fn eq(&self, other: &ProgressParams) -> bool
self and other values to be equal, and is used by ==.