pub struct Pap {
pub closure: Closure,
pub args: Vec<RtObject>,
}Expand description
A partial application (PAP).
Created when a closure is applied to fewer arguments than its arity. The PAP stores the original closure and the arguments applied so far.
Fields§
§closure: ClosureThe original closure being partially applied.
args: Vec<RtObject>Arguments applied so far.
Implementations§
Source§impl Pap
impl Pap
Sourcepub fn remaining_arity(&self) -> u16
pub fn remaining_arity(&self) -> u16
Number of arguments still needed.
Sourcepub fn total_arity(&self) -> u16
pub fn total_arity(&self) -> u16
Total arity of the underlying closure.
Sourcepub fn num_applied(&self) -> usize
pub fn num_applied(&self) -> usize
Number of arguments applied so far.
Sourcepub fn is_saturated(&self) -> bool
pub fn is_saturated(&self) -> bool
Check if the PAP is fully saturated (should not happen, but defensive).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pap
impl RefUnwindSafe for Pap
impl Send for Pap
impl Sync for Pap
impl Unpin for Pap
impl UnsafeUnpin for Pap
impl UnwindSafe for Pap
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