pub struct ModelCallPermit<'c> { /* private fields */ }Expand description
Live permission to execute a model call.
While a permit borrows the cursor, no other request can be made, so a
call in flight cannot interleave with further steps. Persist
ModelCallPermit::intent (when present) before calling the provider,
then redeem with the response.
Implementations§
Source§impl ModelCallPermit<'_>
impl ModelCallPermit<'_>
Sourcepub fn intent(&self) -> Option<&Emitted>
pub fn intent(&self) -> Option<&Emitted>
The intent event to persist before executing, or None when the
intent is already in the log (a call the process died in the middle
of, now being re-issued).
Sourcepub fn seq(&self) -> SequenceNumber
pub fn seq(&self) -> SequenceNumber
The position of the intent this call correlates to.
Sourcepub fn record(self, response: Value, usage: TokenUsage) -> Emitted
pub fn record(self, response: Value, usage: TokenUsage) -> Emitted
Records the model’s response, returning the completion event to persist.
Trait Implementations§
Auto Trait Implementations§
impl<'c> !UnwindSafe for ModelCallPermit<'c>
impl<'c> Freeze for ModelCallPermit<'c>
impl<'c> RefUnwindSafe for ModelCallPermit<'c>
impl<'c> Send for ModelCallPermit<'c>
impl<'c> Sync for ModelCallPermit<'c>
impl<'c> Unpin for ModelCallPermit<'c>
impl<'c> UnsafeUnpin for ModelCallPermit<'c>
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