pub fn bulk_read<Read>(
		&mut self,
		reads: &[Read],
	) -> Result<Vec<BulkData<Vec<u8>>>, TransferError>
	where
		Read: AsRef<BulkRead>,
	{
		let mut responses = Vec::with_capacity(reads.len());
		let mut read_error = None;

		self.bulk_read_cb(reads, |bulk_data| {
			if read_error.is_none() {
				match bulk_data {
					Err(e) => read_error = Some(e),
					Ok(bulk_data) => responses.push(BulkData {
						motor_id: bulk_data.motor_id,
						address: bulk_data.address,
						data: bulk_data.data.to_owned(),
					}),
				}
			}
		})?;

		if let Some(e) = read_error {
			Err(e.into())
		} else {
			Ok(responses)
		}
	}
/// Synchronously read arbitrary data ranges from multiple motors in one command.
///
/// Unlike the sync read instruction, a bulk read can be used to read a different amount of data from a different address for each motor.
///
/// If this function fails to get the data from any of the motors, the entire function retrns an error.
/// If you need access to the data from other motors, or if you want acces to the error for each motor, see [`Self::bulk_read_cb`].
///
/// # Panics
/// The protocol forbids specifying the same motor ID multiple times.
/// This function panics if the same motor ID is used for more than one read.
Synchronously read arbitrary data ranges from multiple motors in one command.
Unlike the sync read instruction, a bulk read can be used to read a different amount of data from a different address for each motor.

If this function fails to get the data from any of the motors, the entire function retrns an error.
If you need access to the data from other motors, or if you want acces to the error for each motor, see [`Self::bulk_read_cb`].
Synchronously read arbitrary data ranges from multiple motors in one command . Unlike the sync read instruction a bulk read can be used to read a different amount of data from a different address for each motor . If this function fails to get the data from any of the motors the entire function retrns an error . If you need access to the data from other motors or if you want acces to the error for each motor see [ ` Self :: bulk_read_cb ` ] .
pub fn bulk_read<Read>(
		&mut self,
		reads: &[Read],
	) -> Result<Vec<BulkData<Vec<u8>>>, TransferError>
	where
		Read: AsRef<BulkRead>,
	{
		let mut responses = Vec::with_capacity(reads.len());
		let mut read_error = None;
		self.bulk_read_cb(reads, |bulk_data| {
			if read_error.is_none() {
				match bulk_data {
					Err(e) => read_error = Some(e),
					Ok(bulk_data) => responses.push(BulkData {
						motor_id: bulk_data.motor_id,
						address: bulk_data.address,
						data: bulk_data.data.to_owned(),
					}),
				}
			}
		})?;
		if let Some(e) = read_error {
			Err(e.into())
		} else {
			Ok(responses)
		}
	}
pub fn bulk_read < Read > ( & mut self , reads : & [ Read ] , ) -> Result < Vec < BulkData < Vec < u8 > > > , TransferError > where Read : AsRef < BulkRead > , { let mut responses = Vec :: with_capacity ( reads . len ( ) ) ; let mut read_error = None ; self . bulk_read_cb ( reads , | bulk_data | { if read_error . is_none ( ) { match bulk_data { Err ( e ) => read_error = Some ( e ) , Ok ( bulk_data ) => responses . push ( BulkData { motor_id : bulk_data . motor_id , address : bulk_data . address , data : bulk_data . data . to_owned ( ) , } ) , } } } ) ? ; if let Some ( e ) = read_error { Err ( e . into ( ) ) } else { Ok ( responses ) } }
Synchronously read arbitrary data ranges from multiple motors in one command.
Synchronously read arbitrary data ranges from multiple motors in one command .
&mut self
reads
&[Read]
&mut self
reads
&[Read]
panics
The protocol forbids specifying the same motor ID multiple times.
This function panics if the same motor ID is used for more than one read.
The protocol forbids specifying the same motor ID multiple times . This function panics if the same motor ID is used for more than one read .