fn write_to_delegate(&mut self, current_output_len: usize) -> Result<()> {
        self.panicked = true;
        let res = self
            .delegate
            .as_mut()
            .expect("Writer must be present")
            .write(&self.output[..current_output_len]);
        self.panicked = false;

        res.map(|consumed| {
            debug_assert!(consumed <= current_output_len);

            if consumed < current_output_len {
                self.output_occupied_len = current_output_len.checked_sub(consumed).unwrap();
                // If we're blocking on I/O, the minor inefficiency of copying bytes to the
                // start of the buffer is the least of our concerns...
                // Rotate moves more than we need to, but copy_within isn't stabilized yet.
                self.output.rotate_left(consumed);
            } else {
                self.output_occupied_len = 0;
            }
        })
    }
/// Write as much of the encoded output to the delegate writer as it will accept, and store the
/// leftovers to be attempted at the next write() call. Updates `self.output_occupied_len`.
///
/// # Errors
///
/// Errors from the delegate writer are returned. In the case of an error,
/// `self.output_occupied_len` will not be updated, as errors from `write` are specified to mean
/// that no write took place.
Write as much of the encoded output to the delegate writer as it will accept, and store the
leftovers to be attempted at the next write() call.
Write as much of the encoded output to the delegate writer as it will accept and store the leftovers to be attempted at the next write () call .
fn write_to_delegate(&mut self, current_output_len: usize) -> Result<()> {
        self.panicked = true;
        let res = self
            .delegate
            .as_mut()
            .expect("Writer must be present")
            .write(&self.output[..current_output_len]);
        self.panicked = false;
        res.map(|consumed| {
            debug_assert!(consumed <= current_output_len);
            if consumed < current_output_len {
                self.output_occupied_len = current_output_len.checked_sub(consumed).unwrap();
                // If we're blocking on I/O, the minor inefficiency of copying bytes to the
                // start of the buffer is the least of our concerns...
                // Rotate moves more than we need to, but copy_within isn't stabilized yet.
                self.output.rotate_left(consumed);
            } else {
                self.output_occupied_len = 0;
            }
        })
    }
fn write_to_delegate ( & mut self , current_output_len : usize ) -> Result < ( ) > { self . panicked = true ; let res = self . delegate . as_mut ( ) . expect ( " " ) . write ( & self . output [ .. current_output_len ] ) ; self . panicked = false ; res . map ( | consumed | { debug_assert ! ( consumed current_output_len ) ; if consumed < current_output_len { self . output_occupied_len = current_output_len . checked_sub ( consumed ) . unwrap ( ) ; // If we're blocking on I/O, the minor inefficiency of copying bytes to the // start of the buffer is the least of our concerns... // Rotate moves more than we need to, but copy_within isn't stabilized yet. self . output . rotate_left ( consumed ) ; } else { self . output_occupied_len = 0 ; } } ) }
Write as much of the encoded output to the delegate writer as it will accept, and store the
leftovers to be attempted at the next write() call.
Write as much of the encoded output to the delegate writer as it will accept and store the leftovers to be attempted at the next write () call .
&mut self
current_output_len
usize
&mut self
current_output_len
usize
errors
Errors from the delegate writer are returned. In the case of an error,
`self.output_occupied_len` will not be updated, as errors from `write` are specified to mean
that no write took place.
Errors from the delegate writer are returned . In the case of an error ` self . output_occupied_len ` will not be updated as errors from ` write ` are specified to mean that no write took place .