pub struct ToolProgress { /* private fields */ }Expand description
Non-durable tool execution progress.
Implementations§
Source§impl ToolProgress
impl ToolProgress
Sourcepub fn new(
message: impl Into<String>,
completed_units: u64,
total_units: Option<u64>,
) -> Result<Self, ToolStreamViolation>
pub fn new( message: impl Into<String>, completed_units: u64, total_units: Option<u64>, ) -> Result<Self, ToolStreamViolation>
Creates bounded monotonic progress metadata.
§Errors
Returns an error for invalid messages or completed units above total.
Sourcepub fn with_details(self, details: ProtocolMetadata) -> Self
pub fn with_details(self, details: ProtocolMetadata) -> Self
Adds bounded safe progress details.
Sourcepub const fn completed_units(&self) -> u64
pub const fn completed_units(&self) -> u64
Returns completed units.
Sourcepub const fn total_units(&self) -> Option<u64>
pub const fn total_units(&self) -> Option<u64>
Returns total units.
Sourcepub const fn details(&self) -> &ProtocolMetadata
pub const fn details(&self) -> &ProtocolMetadata
Returns bounded safe progress details.
Trait Implementations§
Source§impl Clone for ToolProgress
impl Clone for ToolProgress
Source§fn clone(&self) -> ToolProgress
fn clone(&self) -> ToolProgress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolProgress
impl Debug for ToolProgress
Source§impl PartialEq for ToolProgress
impl PartialEq for ToolProgress
impl StructuralPartialEq for ToolProgress
Auto Trait Implementations§
impl Freeze for ToolProgress
impl RefUnwindSafe for ToolProgress
impl Send for ToolProgress
impl Sync for ToolProgress
impl Unpin for ToolProgress
impl UnsafeUnpin for ToolProgress
impl UnwindSafe for ToolProgress
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