pub enum CountBound {
Unlimited,
AtMost(u64),
}Expand description
A numeric upper bound axis (e.g. “at most N tool calls”).
Unlimited is the top; AtMost(n) ⊑ AtMost(m) ⟺ n ≤ m. The meet is the
tighter (smaller) bound.
Variants§
Implementations§
Source§impl CountBound
impl CountBound
Sourcepub fn leq(&self, other: &Self) -> bool
pub fn leq(&self, other: &Self) -> bool
self ⊑ other — is self at least as tight a bound as other?
Sourcepub fn permits_one_more(&self, used_so_far: u64) -> bool
pub fn permits_one_more(&self, used_so_far: u64) -> bool
Does this bound permit one more call when used_so_far calls have
already been counted against it?
Unlimited always permits; AtMost(n) permits iff used_so_far < n.
Trait Implementations§
Source§impl Clone for CountBound
impl Clone for CountBound
Source§fn clone(&self) -> CountBound
fn clone(&self) -> CountBound
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 CountBound
impl Debug for CountBound
Source§impl<'de> Deserialize<'de> for CountBound
impl<'de> Deserialize<'de> for CountBound
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
Source§impl PartialEq for CountBound
impl PartialEq for CountBound
Source§fn eq(&self, other: &CountBound) -> bool
fn eq(&self, other: &CountBound) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CountBound
impl Serialize for CountBound
impl Copy for CountBound
impl Eq for CountBound
impl StructuralPartialEq for CountBound
Auto Trait Implementations§
impl Freeze for CountBound
impl RefUnwindSafe for CountBound
impl Send for CountBound
impl Sync for CountBound
impl Unpin for CountBound
impl UnsafeUnpin for CountBound
impl UnwindSafe for CountBound
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