pub struct ProgressState { /* private fields */ }Expand description
Mutable progress buffer shared between handler and heartbeat service.
Implementations§
Source§impl ProgressState
impl ProgressState
pub fn new(initial: Option<Value>) -> Self
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Whether there is a pending update that has not been acked.
Sourcepub fn clone_latest(&self) -> Option<Value>
pub fn clone_latest(&self) -> Option<Value>
Clone the latest progress value.
Sourcepub fn set_progress(&mut self, percent: u8, message: Option<&str>)
pub fn set_progress(&mut self, percent: u8, message: Option<&str>)
Set progress: percent (clamped 0-100), optional message. Preserves existing metadata sub-object.
Sourcepub fn merge_metadata(&mut self, updates: &Map<String, Value>) -> bool
pub fn merge_metadata(&mut self, updates: &Map<String, Value>) -> bool
Shallow-merge keys into the metadata sub-object.
Returns false if the existing metadata sub-object is a non-object type (no-op).
Sourcepub fn pending_snapshot(&self) -> Option<(Value, u64)>
pub fn pending_snapshot(&self) -> Option<(Value, u64)>
Snapshot for flush: returns (value, generation) if there is a pending update.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProgressState
impl RefUnwindSafe for ProgressState
impl Send for ProgressState
impl Sync for ProgressState
impl Unpin for ProgressState
impl UnsafeUnpin for ProgressState
impl UnwindSafe for ProgressState
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more