/// Get a slice to the available output space.
///
/// The future resolves once output space is available.
/// The returned slice will never be empty.
Get a slice to the available output space.
The future resolves once output space is available.
The returned slice will never be empty.
Get a slice to the available output space . The future resolves once output space is available . The returned slice will never be empty .
pub async fn slice(&mut self) -> &mut [T] {
        // ugly workaround for borrow-checker problem
        // https://github.com/rust-lang/rust/issues/21906
        let (p, s) = loop {
            match self.writer.slice(true) {
                [] => {
                    let _ = self.chan.next().await;
                }
                s => break (s.as_mut_ptr(), s.len()),
            }
        };
        unsafe { slice::from_raw_parts_mut(p, s) }
    }
pub async fn slice ( & mut self ) -> & mut [ T ] { // ugly workaround for borrow-checker problem // https://github.com/rust-lang/rust/issues/21906 let ( p , s ) = loop { match self . writer . slice ( true ) { [ ] => { let _ = self . chan . next ( ) . await ; } s => break ( s . as_mut_ptr ( ) , s . len ( ) ) , } } ; unsafe { slice :: from_raw_parts_mut ( p , s ) } }
Get a slice to the available output space.
Get a slice to the available output space .
&mut self