pub fn with_buffers(serial_port: SerialPort, read_timeout: Duration, read_buffer: ReadBuffer, mut write_buffer: WriteBuffer) -> Self {
		// Pre-fill write buffer with the header prefix.
		assert!(write_buffer.as_mut().len() >= HEADER_SIZE + 2);
		write_buffer.as_mut()[..4].copy_from_slice(&HEADER_PREFIX);

		Self {
			serial_port,
			read_timeout,
			read_buffer,
			read_len: 0,
			write_buffer,
		}
	}
/// Create a new bus using pre-allocated buffers.
Create a new bus using pre-allocated buffers.
Create a new bus using pre - allocated buffers .
pub fn with_buffers(serial_port: SerialPort, read_timeout: Duration, read_buffer: ReadBuffer, mut write_buffer: WriteBuffer) -> Self {
		// Pre-fill write buffer with the header prefix.
		assert!(write_buffer.as_mut().len() >= HEADER_SIZE + 2);
		write_buffer.as_mut()[..4].copy_from_slice(&HEADER_PREFIX);
		Self {
			serial_port,
			read_timeout,
			read_buffer,
			read_len: 0,
			write_buffer,
		}
	}
pub fn with_buffers ( serial_port : SerialPort , read_timeout : Duration , read_buffer : ReadBuffer , mut write_buffer : WriteBuffer ) -> Self { // Pre-fill write buffer with the header prefix. assert ! ( write_buffer as_mut ( ) len ( ) HEADER_SIZE 2 ) ; write_buffer . as_mut ( ) [ .. 4 ] . copy_from_slice ( & HEADER_PREFIX ) ; Self { serial_port , read_timeout , read_buffer , read_len : 0 , write_buffer , } }
Create a new bus using pre-allocated buffers.
Create a new bus using pre - allocated buffers .
serial_port
SerialPort
read_timeout
Duration
read_buffer
ReadBuffer
write_buffer
WriteBuffer
serial_port
SerialPort
read_timeout
Duration
read_buffer
ReadBuffer
write_buffer
WriteBuffer