/// Appends elements from slice to the ring buffer.
/// Elements should be [`Copy`](https://doc.rust-lang.org/std/marker/trait.Copy.html).
///
/// On success returns count of elements been appended to the ring buffer.
Appends elements from slice to the ring buffer.
Elements should be [`Copy`].

On success returns count of elements been appended to the ring buffer.
Appends elements from slice to the ring buffer . Elements should be [ ` Copy ` ] . On success returns count of elements been appended to the ring buffer .
pub fn push_slice(&mut self, elems: &[T]) -> Result<usize, PushSliceError> {
        let push_fn = |left: &mut [T], right: &mut [T]| {
            Ok((if elems.len() < left.len() {
                left[0..elems.len()].copy_from_slice(elems);
                elems.len()
            } else {
                left.copy_from_slice(&elems[0..left.len()]);
                if elems.len() < left.len() + right.len() {
                    right[0..(elems.len() - left.len())]
                        .copy_from_slice(&elems[left.len()..elems.len()]);
                    elems.len()
                } else {
                    right.copy_from_slice(&elems[left.len()..(left.len() + right.len())]);
                    left.len() + right.len()
                }
            }, ()))
        };
        match unsafe { self.push_access(push_fn) } {
            Ok(res) => match res {
                Ok((n, ())) => {
                    Ok(n)
                },
                Err(()) => unreachable!(),
            },
            Err(e) => match e {
                PushAccessError::Full => Err(PushSliceError::Full),
                PushAccessError::BadLen => unreachable!(),
            }
        }
    }
pub fn push_slice ( & mut self , elems : & [ T ] ) -> Result < usize , PushSliceError > { let push_fn = | left : & mut [ T ] , right : & mut [ T ] | { Ok ( ( if elems . len ( ) < left . len ( ) { left [ 0 .. elems . len ( ) ] . copy_from_slice ( elems ) ; elems . len ( ) } else { left . copy_from_slice ( & elems [ 0 .. left . len ( ) ] ) ; if elems . len ( ) < left . len ( ) + right . len ( ) { right [ 0 .. ( elems . len ( ) - left . len ( ) ) ] . copy_from_slice ( & elems [ left . len ( ) .. elems . len ( ) ] ) ; elems . len ( ) } else { right . copy_from_slice ( & elems [ left . len ( ) .. ( left . len ( ) + right . len ( ) ) ] ) ; left . len ( ) + right . len ( ) } } , ( ) ) ) } ; match unsafe { self . push_access ( push_fn ) } { Ok ( res ) => match res { Ok ( ( n , ( ) ) ) => { Ok ( n ) } , Err ( ( ) ) => unreachable ! ( ) , } , Err ( e ) => match e { PushAccessError :: Full => Err ( PushSliceError :: Full ) , PushAccessError :: BadLen => unreachable ! ( ) , } } }
Appends elements from slice to the ring buffer.
Appends elements from slice to the ring buffer .
&mut self
elems
&[T]