Lines Matching refs:u8

102     fn receive_packet(&mut self, out: &mut [u8]) -> Result<usize, TransportError>;  in receive_packet()
108 fn send_packet(&mut self, packet: &[u8]) -> Result<(), TransportError>; in send_packet()
113 const TCP_HANDSHAKE_MESSAGE: &[u8] = b"FB01";
121 fn read_exact(&mut self, out: &mut [u8]) -> Result<(), TransportError>; in read_exact()
124 fn write_exact(&mut self, data: &[u8]) -> Result<(), TransportError>; in write_exact()
144 fn receive_packet(&mut self, out: &mut [u8]) -> Result<usize, TransportError> { in receive_packet()
159 fn send_packet(&mut self, packet: &[u8]) -> Result<(), TransportError> { in send_packet()
177 pub struct CommandError(FormattedBytes<[u8; COMMAND_ERROR_LENGTH]>);
221 out: &mut [u8], in get_var() argument
230 out: &'s mut [u8], in get_var_as_str() argument
352 res: &'a mut [u8], in oem() argument
353 ) -> Result<&'a [u8], CommandError>; in oem() argument
401 download_buffer: &'a mut [u8],
411 download_buffer: &'a mut [u8], in new() argument
419 pub fn download_data(&mut self) -> &mut [u8] { in download_data() argument
427 pub fn take_download_buffer(&mut self) -> (&mut [u8], usize) { in take_download_buffer() argument
478 send: &'a mut dyn FnMut(&[u8]) -> Result<(), CommandError>,
495 send: &'a mut dyn FnMut(&[u8]) -> Result<(), CommandError>,
501 pub fn upload(&mut self, data: &[u8]) -> Result<(), CommandError> { in upload()
521 let mut send = |data: &[u8]| -> Result<(), CommandError> { in with_upload_builder()
546 pub fn with_mock_upload_builder<F>(buffer: &mut [u8], mut f: F) -> (usize, usize) in with_mock_upload_builder() argument
552 let mut send = |data: &[u8]| -> Result<(), CommandError> { in with_mock_upload_builder()
584 download_buffer: &'a mut [u8],
591 pub fn new(download_buffer: &'a mut [u8]) -> Self { in new()
751 out: &'s mut [u8], in get_var_str() argument
921 pub struct FormattedBytes<T: AsMut<[u8]>>(T, usize);
923 impl<T: AsMut<[u8]>> FormattedBytes<T> {
934 pub fn append(&mut self, bytes: &[u8]) -> &mut [u8] { in append() argument
945 impl<T: AsMut<[u8]>> core::fmt::Write for FormattedBytes<T> {
1028 &'a mut dyn FnMut(&str, &mut FastbootUtils, &mut [u8]) -> Result<usize, CommandError>,
1037 out: &mut [u8], in get_var() argument
1088 res: &'b mut [u8], in oem() argument
1089 ) -> Result<&'b [u8], CommandError> { in oem() argument
1096 in_queue: VecDeque<Vec<u8>>,
1097 out_queue: VecDeque<Vec<u8>>,
1105 fn add_input(&mut self, packet: &[u8]) { in add_input() argument
1111 fn receive_packet(&mut self, out: &mut [u8]) -> Result<usize, TransportError> { in receive_packet()
1123 fn send_packet(&mut self, packet: &[u8]) -> Result<(), TransportError> { in send_packet()
1131 in_queue: VecDeque<u8>,
1132 out_queue: VecDeque<u8>,
1137 fn add_input(&mut self, data: &[u8]) { in add_input() argument
1142 fn add_length_prefixed_input(&mut self, data: &[u8]) { in add_length_prefixed_input() argument
1149 fn read_exact(&mut self, out: &mut [u8]) -> Result<(), TransportError> { in read_exact()
1156 fn write_exact(&mut self, data: &[u8]) -> Result<(), TransportError> { in write_exact()
1220 VecDeque::<Vec<u8>>::from([ in test_get_var()
1250 VecDeque::<Vec<u8>>::from([ in test_get_var_all()
1265 let download_content: Vec<u8> = in test_download()
1266 (0..download_buffer.len()).into_iter().map(|v| v as u8).collect(); in test_download()
1277 VecDeque::<Vec<u8>>::from([b"DATA0x400".into(), b"OKAY".into(),]) in test_download()
1312 assert_eq!(transport.out_queue, VecDeque::<Vec<u8>>::from([msg.as_bytes().into()])); in test_download_size()
1329 let download_content: Vec<u8> = vec![0u8; download_buffer.len()]; in test_download_more_than_expected()
1339 VecDeque::<Vec<u8>>::from([ in test_download_more_than_expected()
1352 let download_content: Vec<u8> = (0..1024).into_iter().map(|v| v as u8).collect(); in test_oem_cmd()
1359 let mut oem_cb = |cmd: &str, utils: &mut FastbootUtils, res: &mut [u8]| { in test_oem_cmd()
1371 VecDeque::<Vec<u8>>::from([ in test_oem_cmd()
1386 let download_content: Vec<u8> = (0..1024).into_iter().map(|v| v as u8).collect(); in test_flash()
1402 VecDeque::<Vec<u8>>::from([b"DATA0x400".into(), b"OKAY".into(), b"OKAY".into(),]) in test_flash()
1423 let download_content: Vec<u8> = (0..1024).into_iter().map(|v| v as u8).collect(); in test_upload()
1446 VecDeque::<Vec<u8>>::from([ in test_upload()
1515 VecDeque::<Vec<u8>>::from([ in test_fetch()
1548 let download_content: Vec<u8> = in test_fastboot_tcp()
1549 (0..download_buffer.len()).into_iter().map(|v| v as u8).collect(); in test_fastboot_tcp()
1560 let expected: &[&[u8]] = &[ in test_fastboot_tcp()