Lines Matching defs:split_at

307         let (bytes, suffix) = bytes.split_at(mem::size_of::<T>()).map_err(
312 // large as `T`. `bytes.split_at(mem::size_of::<T>())?` ensures that the
315 // `SplitByteSlice::split_at` we can rely on `split_at` to produce the
328 let split_at = if let Some(split_at) = bytes_len.checked_sub(mem::size_of::<T>()) {
329 split_at
333 let (prefix, bytes) = bytes.split_at(split_at).map_err(|b| SizeError::new(b).into())?;
337 // SAFETY: Since `split_at` is defined as `bytes_len - size_of::<T>()`,
339 // bytes.split_at(split_at)?` has length `size_of::<T>()`, measured in
342 // `SplitByteSlice::split_at` we can rely on `split_at` to produce the
534 let split_at = unsafe { source.len().unchecked_sub(remainder.len()) };
535 let (bytes, suffix) = source.split_at(split_at).map_err(|b| SizeError::new(b).into())?;
540 // Therefore, `split_at` is the typed pointer's byte length. By the
541 // safety postcondition of `SplitByteSlice::split_at`, `bytes` has that
641 let split_at = remainder.len();
642 let (prefix, bytes) = source.split_at(split_at).map_err(|b| SizeError::new(b).into())?;
648 // `r_slice` produced by `split_at_unchecked(split_at)` and returns its
652 // postcondition of `SplitByteSlice::split_at`, `bytes` retains that
844 let (prefix, bytes) = source.split_at(expected_len).map_err(SizeError::new)?;
908 let split_at = if let Some(split_at) = source.len().checked_sub(expected_len) {
909 split_at
914 // guarantees that `split_at` is in-bounds.
915 let (bytes, suffix) = unsafe { source.split_at_unchecked(split_at) };