pub struct Scan {
pub body: Callee,
pub init: LocalValueId,
pub src: LocalValueId,
pub captures: Vec<LocalValueId>,
}Expand description
A total left-scan out[i] = acc_i+1 where acc_i+1 = body(acc_i, src[i], captures…) and acc_0 = init. The result is [U; N] where N is src’s
length and U is the body’s return type (also the accumulator’s type).
Fields§
§body: CalleeThe pure per-element fold function, applied at each lane. A symbol, not an
operand — exactly like a direct call’s target. Binary in (accumulator, element).
init: LocalValueIdThe initial accumulator value (acc_0).
src: LocalValueIdThe array value scanned over.
captures: Vec<LocalValueId>Loop-invariant values the body closes over (the accumulator and element are supplied per-lane by the scan itself). Empty for a closed body.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scan
impl<'de> Deserialize<'de> for Scan
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
impl Eq for Scan
impl StructuralPartialEq for Scan
Auto Trait Implementations§
impl Freeze for Scan
impl RefUnwindSafe for Scan
impl Send for Scan
impl Sync for Scan
impl Unpin for Scan
impl UnsafeUnpin for Scan
impl UnwindSafe for Scan
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