pub struct ArityContract { /* private fields */ }Expand description
One builtin’s compile-phase arity contract: the accepted argument-count range together with the authored rejection detail (bare, without the class token). Declared in the shared contract layer so the front-end check, the planner’s rule table and the executor’s dispatch read one fact instead of a count and a message each.
Implementations§
Source§impl ArityContract
impl ArityContract
Sourcepub const fn min(self) -> usize
pub const fn min(self) -> usize
The least accepted argument count — the executor’s dispatch gate derives its row bounds from here, so the count has one home.
Sourcepub fn violation(self, count: usize) -> Option<&'static str>
pub fn violation(self, count: usize) -> Option<&'static str>
The authored rejection detail a call supplying count arguments
violates, or None when it satisfies the contract. The accept test
and the rejection travel together, so no consumer can pair them
wrongly; each layer composes the class token once around the detail.
Trait Implementations§
Source§impl Clone for ArityContract
impl Clone for ArityContract
impl Copy for ArityContract
Source§impl Debug for ArityContract
impl Debug for ArityContract
impl Eq for ArityContract
Source§impl PartialEq for ArityContract
impl PartialEq for ArityContract
impl StructuralPartialEq for ArityContract
Auto Trait Implementations§
impl Forget for ArityContract
impl Freeze for ArityContract
impl Move for ArityContract
impl RefUnwindSafe for ArityContract
impl Send for ArityContract
impl Sync for ArityContract
impl Unpin for ArityContract
impl UnsafeUnpin for ArityContract
impl UnwindSafe for ArityContract
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.