pub fn send_foreach<F: FnMut() -> T>(&mut self, mut count: usize, mut f: F) -> Status {
        loop {
            let status = self.send(|p, c| {
                let mut j = 0;
                while j < c && count > 0 {
                    unsafe { ptr::write(p.offset(j as isize), f()) };
                    j += 1;
                    count -= 1;
                };
                j
            }).unwrap();
            if status.remaining == 0 || count == 0 { return status; }
        }
    }
/// "Safe" version of send. Will call your closure up to "count" times
/// and depend on optimisation to avoid memory copies.
///
/// # Panics
///
/// Panics in case the buffer is corrupt.
"Safe" version of send. Will call your closure up to "count" times
and depend on optimisation to avoid memory copies.
" Safe " version of send . Will call your closure up to " count " times and depend on optimisation to avoid memory copies .
pub fn send_foreach<F: FnMut() -> T>(&mut self, mut count: usize, mut f: F) -> Status {
        loop {
            let status = self.send(|p, c| {
                let mut j = 0;
                while j < c && count > 0 {
                    unsafe { ptr::write(p.offset(j as isize), f()) };
                    j += 1;
                    count -= 1;
                };
                j
            }).unwrap();
            if status.remaining == 0 || count == 0 { return status; }
        }
    }
pub fn send_foreach < F : FnMut ( ) -> T > ( & mut self , mut count : usize , mut f : F ) -> Status { loop { let status = self . send ( | p , c | { let mut j = 0 ; while j < c && count > 0 { unsafe { ptr :: write ( p . offset ( j as isize ) , f ( ) ) } ; j += 1 ; count -= 1 ; } ; j } ) . unwrap ( ) ; if status . remaining == 0 || count == 0 { return status ; } } }
"Safe" version of send.
" Safe " version of send .
&mut self
count
usize
f
F
&mut self
count
usize
f
F
panics
Panics in case the buffer is corrupt.
Panics in case the buffer is corrupt .