pub fn sync_read<'a, F>(
		&'a mut self,
		motor_ids: &'a [u8],
		address: u16,
		count: u16,
	) -> Result<Vec<SyncData<Vec<u8>>>, TransferError> {
		let mut result = Vec::with_capacity(motor_ids.len());
		let mut read_error = None;
		self.sync_read_cb(motor_ids, address, count, |data| {
			match data {
				Err(e) if read_error.is_none() => read_error = Some(e),
				Err(_) => (),
				Ok(response) => result.push(SyncData {
					motor_id: response.motor_id,
					data: response.data.to_owned(),
				}),
			}
		})?;
		Ok(result)
	}
/// Synchronously read an arbitrary number of bytes from multiple motors in one command.
///
/// 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::sync_read_cb`].
Synchronously read an arbitrary number of bytes from multiple motors in one command.
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::sync_read_cb`].
Synchronously read an arbitrary number of bytes from multiple motors in one command . 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 :: sync_read_cb ` ] .
pub fn sync_read<'a, F>(
		&'a mut self,
		motor_ids: &'a [u8],
		address: u16,
		count: u16,
	) -> Result<Vec<SyncData<Vec<u8>>>, TransferError> {
		let mut result = Vec::with_capacity(motor_ids.len());
		let mut read_error = None;
		self.sync_read_cb(motor_ids, address, count, |data| {
			match data {
				Err(e) if read_error.is_none() => read_error = Some(e),
				Err(_) => (),
				Ok(response) => result.push(SyncData {
					motor_id: response.motor_id,
					data: response.data.to_owned(),
				}),
			}
		})?;
		Ok(result)
	}
pub fn sync_read < ' a , F > ( & ' a mut self , motor_ids : & ' a [ u8 ] , address : u16 , count : u16 , ) -> Result < Vec < SyncData < Vec < u8 > > > , TransferError > { let mut result = Vec :: with_capacity ( motor_ids . len ( ) ) ; let mut read_error = None ; self . sync_read_cb ( motor_ids , address , count , | data | { match data { Err ( e ) if read_error . is_none ( ) => read_error = Some ( e ) , Err ( _ ) => ( ) , Ok ( response ) => result . push ( SyncData { motor_id : response . motor_id , data : response . data . to_owned ( ) , } ) , } } ) ? ; Ok ( result ) }
Synchronously read an arbitrary number of bytes from multiple motors in one command.
Synchronously read an arbitrary number of bytes from multiple motors in one command .
&'a mut self
motor_ids
&'a [u8]
address
u16
count
u16
&'a mut self
motor_ids
&'a [u8]
address
u16
count
u16