pub struct Arity { /* private fields */ }Expand description
How many operands an intrinsic takes: from min to
max, both inclusive (at most 255, an import’s limit).
§Examples
use bcgen_lang::Arity;
assert!(Arity::exact(2).accepts(2));
assert!(!Arity::exact(2).accepts(3));
assert!(Arity::at_least(1).accepts(255));
assert_eq!(Arity::at_least(1).to_string(), "1 to 255");Implementations§
Source§impl Arity
impl Arity
Sourcepub const fn range(min: u8, max: u8) -> Self
pub const fn range(min: u8, max: u8) -> Self
From min to max operands (a max below min is raised to it).
§Examples
use bcgen_lang::Arity;
assert_eq!(Arity::range(2, 1), Arity::exact(2));Trait Implementations§
impl Copy for Arity
impl Eq for Arity
impl StructuralPartialEq for Arity
Auto Trait Implementations§
impl Freeze for Arity
impl RefUnwindSafe for Arity
impl Send for Arity
impl Sync for Arity
impl Unpin for Arity
impl UnsafeUnpin for Arity
impl UnwindSafe for Arity
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