pub struct ToolProgressUpdate { /* private fields */ }Expand description
One normalized numeric progress observation requested by a tool.
Units are tool-defined by its registered contract. A known total is
positive and cannot be smaller than completed. The reporter enforces
strict monotonicity across observations and freezes a total once declared.
Implementations§
Source§impl ToolProgressUpdate
impl ToolProgressUpdate
Sourcepub const fn new(
completed: ExecutionCount,
total: Option<ExecutionCount>,
) -> Result<Self, ToolProgressUpdateError>
pub const fn new( completed: ExecutionCount, total: Option<ExecutionCount>, ) -> Result<Self, ToolProgressUpdateError>
Constructs a structurally valid progress observation.
§Errors
Returns ToolProgressUpdateError for a zero total or completed value
greater than the known total.
Sourcepub const fn completed(self) -> ExecutionCount
pub const fn completed(self) -> ExecutionCount
Returns completed tool-defined units.
Sourcepub const fn total(self) -> Option<ExecutionCount>
pub const fn total(self) -> Option<ExecutionCount>
Returns the known total tool-defined units, when declared.
Trait Implementations§
Source§impl Clone for ToolProgressUpdate
impl Clone for ToolProgressUpdate
impl Copy for ToolProgressUpdate
Source§impl Debug for ToolProgressUpdate
impl Debug for ToolProgressUpdate
Source§impl<'de> Deserialize<'de> for ToolProgressUpdate
impl<'de> Deserialize<'de> for ToolProgressUpdate
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolProgressUpdate
Source§impl JsonSchema for ToolProgressUpdate
impl JsonSchema for ToolProgressUpdate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ToolProgressUpdate
impl PartialEq for ToolProgressUpdate
Source§impl Serialize for ToolProgressUpdate
impl Serialize for ToolProgressUpdate
impl StructuralPartialEq for ToolProgressUpdate
Auto Trait Implementations§
impl Forget for ToolProgressUpdate
impl Freeze for ToolProgressUpdate
impl Move for ToolProgressUpdate
impl RefUnwindSafe for ToolProgressUpdate
impl Send for ToolProgressUpdate
impl Sync for ToolProgressUpdate
impl Unpin for ToolProgressUpdate
impl UnsafeUnpin for ToolProgressUpdate
impl UnwindSafe for ToolProgressUpdate
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