pub async fn slice(&mut self) -> Option<&[T]> {
        // ugly workaround for borrow-checker problem
        // https://github.com/rust-lang/rust/issues/21906
        let r = loop {
            match self.reader.slice(true) {
                Some(([], _)) => {
                    let _ = self.chan.next().await;
                }
                Some((s, _)) => break Some((s.as_ptr(), s.len())),
                None => break None,
            }
        };

        if let Some((p, s)) = r {
            unsafe { Some(slice::from_raw_parts(p, s)) }
        } else {
            None
        }
    }
/// Blocks until there is data to read or until the writer is dropped.
///
/// If all data is read and the writer is dropped, all following calls will
/// return `None`. If `Some` is returned, the contained slice is never empty.
Blocks until there is data to read or until the writer is dropped.
If all data is read and the writer is dropped, all following calls will
return `None`. If `Some` is returned, the contained slice is never empty.
Blocks until there is data to read or until the writer is dropped . If all data is read and the writer is dropped all following calls will return ` None ` . If ` Some ` is returned the contained slice is never empty .
pub async fn slice(&mut self) -> Option<&[T]> {
        // ugly workaround for borrow-checker problem
        // https://github.com/rust-lang/rust/issues/21906
        let r = loop {
            match self.reader.slice(true) {
                Some(([], _)) => {
                    let _ = self.chan.next().await;
                }
                Some((s, _)) => break Some((s.as_ptr(), s.len())),
                None => break None,
            }
        };
        if let Some((p, s)) = r {
            unsafe { Some(slice::from_raw_parts(p, s)) }
        } else {
            None
        }
    }
pub async fn slice ( & mut self ) -> Option < & [ T ] > { // ugly workaround for borrow-checker problem // https://github.com/rust-lang/rust/issues/21906 let r = loop { match self . reader . slice ( true ) { Some ( ( [ ] , _ ) ) => { let _ = self . chan . next ( ) . await ; } Some ( ( s , _ ) ) => break Some ( ( s . as_ptr ( ) , s . len ( ) ) ) , None => break None , } } ; if let Some ( ( p , s ) ) = r { unsafe { Some ( slice :: from_raw_parts ( p , s ) ) } } else { None } }
Blocks until there is data to read or until the writer is dropped.
Blocks until there is data to read or until the writer is dropped .
&mut self
&mut self