pub struct AttemptControl { /* private fields */ }Expand description
One model attempt’s control plane: the turn-shared CancellationToken
plus the effective attempt deadline (turn deadline folded with the
attempt timeout).
Implementations§
Source§impl AttemptControl
impl AttemptControl
Sourcepub fn new(cancellation: CancellationToken, deadline: Option<Instant>) -> Self
pub fn new(cancellation: CancellationToken, deadline: Option<Instant>) -> Self
Builds an attempt control. External drivers construct these directly
— e.g. through the causa_runtime::control::RunControl::for_attempt
chain or from a bare token.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the turn’s cancellation has fired.
Sourcepub fn cancellation_token(&self) -> &CancellationToken
pub fn cancellation_token(&self) -> &CancellationToken
The turn-shared primitive — race it against in-flight provider work
(select!) instead of polling.
Sourcepub fn for_call(&self, call_timeout: Option<Duration>) -> CallControl
pub fn for_call(&self, call_timeout: Option<Duration>) -> CallControl
Narrows this attempt control into a CallControl for one tool
call, folding call_timeout into the deadline chain.
Trait Implementations§
Source§impl Clone for AttemptControl
impl Clone for AttemptControl
Source§fn clone(&self) -> AttemptControl
fn clone(&self) -> AttemptControl
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 moreAuto Trait Implementations§
impl Freeze for AttemptControl
impl RefUnwindSafe for AttemptControl
impl Send for AttemptControl
impl Sync for AttemptControl
impl Unpin for AttemptControl
impl UnsafeUnpin for AttemptControl
impl UnwindSafe for AttemptControl
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