pub fn enqueue_raw_bytes(&mut self, input: &[u8]) -> Result<usize, Error<T::E>> {
        let mut write_count = 0;
        if !self.is_in_loop_mode() {
            if self.fifo_capacity() == 0 {
                return Err(Error::FullFifo);
            }
            write_count = std::cmp::min(self.fifo_capacity(), input.len());
            if write_count > 0 {
                self.in_buffer.extend(&input[0..write_count]);
                self.set_lsr_rda_bit();
                self.received_data_interrupt().map_err(Error::Trigger)?;
            }
        }
        Ok(write_count)
    }
/// Helps in sending more bytes to the guest in one shot, by storing
/// `input` bytes in UART buffer and letting the driver know there is
/// some pending data to be read by setting RDA bit and its corresponding
/// interrupt when not already triggered.
///
/// # Arguments
/// * `input` - The data to be sent to the guest.
///
/// # Returns
///
/// The function returns the number of bytes it was able to write to the fifo,
/// or `FullFifo` error when the fifo is full. Users can use
/// [`fifo_capacity`](#method.fifo_capacity) before calling this function
/// to check the available space.
///
/// # Example
///
/// You can see an example of how to use this function in the
/// [`Example` section from `Serial`](struct.Serial.html#example).
Helps in sending more bytes to the guest in one shot, by storing
`input` bytes in UART buffer and letting the driver know there is
some pending data to be read by setting RDA bit and its corresponding
interrupt when not already triggered.
Helps in sending more bytes to the guest in one shot by storing ` input ` bytes in UART buffer and letting the driver know there is some pending data to be read by setting RDA bit and its corresponding interrupt when not already triggered .
pub fn enqueue_raw_bytes(&mut self, input: &[u8]) -> Result<usize, Error<T::E>> {
        let mut write_count = 0;
        if !self.is_in_loop_mode() {
            if self.fifo_capacity() == 0 {
                return Err(Error::FullFifo);
            }
            write_count = std::cmp::min(self.fifo_capacity(), input.len());
            if write_count > 0 {
                self.in_buffer.extend(&input[0..write_count]);
                self.set_lsr_rda_bit();
                self.received_data_interrupt().map_err(Error::Trigger)?;
            }
        }
        Ok(write_count)
    }
pub fn enqueue_raw_bytes ( & mut self , input : & [ u8 ] ) -> Result < usize , Error < T :: E > > { let mut write_count = 0 ; if ! self . is_in_loop_mode ( ) { if self . fifo_capacity ( ) == 0 { return Err ( Error :: FullFifo ) ; } write_count = std :: cmp :: min ( self . fifo_capacity ( ) , input . len ( ) ) ; if write_count > 0 { self . in_buffer . extend ( & input [ 0 .. write_count ] ) ; self . set_lsr_rda_bit ( ) ; self . received_data_interrupt ( ) . map_err ( Error :: Trigger ) ? ; } } Ok ( write_count ) }
Helps in sending more bytes to the guest in one shot, by storing
`input` bytes in UART buffer and letting the driver know there is
some pending data to be read by setting RDA bit and its corresponding
interrupt when not already triggered.
Helps in sending more bytes to the guest in one shot by storing ` input ` bytes in UART buffer and letting the driver know there is some pending data to be read by setting RDA bit and its corresponding interrupt when not already triggered .
&mut self
input
&[u8]
The function returns the number of bytes it was able to write to the fifo,
or `FullFifo` error when the fifo is full. Users can use
[`fifo_capacity`](#method.fifo_capacity) before calling this function
to check the available space.
The function returns the number of bytes it was able to write to the fifo or ` FullFifo ` error when the fifo is full . Users can use [ ` fifo_capacity ` ] ( #method . fifo_capacity ) before calling this function to check the available space .
&mut self
input
&[u8]
example
You can see an example of how to use this function in the
[`Example` section from `Serial`](struct.Serial.html#example).
You can see an example of how to use this function in the [ ` Example ` section from ` Serial ` ] ( struct . Serial . html#example ) .