Lines Matching defs:split

15 /// Types that can be split in two.
98 /// The element type exposed by the split's returned slice.
141 /// Attempts to split `self` in two.
167 /// // Attempt to split `packet` at `length`.
168 /// let split = packet.split_at(packet.length as usize).unwrap();
172 /// let (packet, rest) = split.via_immutable();
226 /// Attempts to split `self` in two.
253 /// // Attempt to split `packet` at `length`.
254 /// let split = packet.split_at_mut(packet.length as usize).unwrap();
258 /// let (packet, rest) = split.via_into_bytes();
324 /// A `T` that has been split into two possibly-overlapping parts.
328 /// length](KnownLayout#slice-dst-layout). If `T` is split at a length that
330 /// split `T` will overlap the right part. If `T` is a mutable reference or
334 /// or [`Self::via_runtime_check`] to check a particular split. Shared references
374 /// Produces the split parts of `self`, using [`Immutable`] to ensure that
398 /// // Attempt to split `packet` at `length`.
399 /// let split = packet.split_at(packet.length as usize).unwrap();
403 /// let (packet, rest) = split.via_immutable();
437 /// Produces the split parts of `self`, using [`IntoBytes`] to ensure that
461 /// // Attempt to split `packet` at `length`.
462 /// let split = packet.split_at(packet.length as usize).unwrap();
466 /// let (packet, rest) = split.via_into_bytes();
486 /// Produces the split parts of `self` using [`Self::via_no_dynamic_padding`].
498 /// Produces the split parts of `self` using a compile-time assertion to
527 /// if let Some(split) = packet.split_at(packet.length as usize) {
529 /// let (packet, rest) = split.via_no_dynamic_padding();
557 /// if let Some(split) = packet.split_at(packet.length as usize) {
558 /// let _ = split.via_no_dynamic_padding(); // ⚠ Compile Error!
564 /// If you need to split such types, use [`Self::via_runtime_check`].
576 /// Produces the split parts of `self`, using a dynamic check to ensure that
604 /// if let Some(split) = packet.split_at(packet.length as usize) {
605 /// if let Ok((packet, rest)) = split.via_runtime_check() {
617 /// if let Some(split) = packet.split_at((packet.length - 1) as usize) {
618 /// assert!(split.via_runtime_check().is_err());
650 /// Unsafely produces the split parts of `self`.
683 // left and right portions of `self` split at `l_len` do not overlap.
701 /// Produces the split parts of `self`, using [`IntoBytes`] to ensure that
726 /// // Attempt to split `packet` at `length`.
727 /// let split = packet.split_at_mut(packet.length as usize).unwrap();
731 /// let (packet, rest) = split.via_into_bytes();
757 /// Produces the split parts of `self` using [`Self::via_no_dynamic_padding`].
769 /// Produces the split parts of `self` using a compile-time assertion to
799 /// if let Some(split) = packet.split_at_mut(packet.length as usize) {
800 /// let (packet, rest) = split.via_no_dynamic_padding();
832 /// if let Some(split) = packet.split_at_mut(packet.length as usize) {
833 /// let _ = split.via_no_dynamic_padding(); // ⚠ Compile Error!
839 /// If you need to split such types, use [`Self::via_runtime_check`].
851 /// Produces the split parts of `self`, using a dynamic check to ensure that
875 /// if let Some(split) = packet.split_at_mut(packet.length as usize) {
876 /// if let Ok((packet, rest)) = split.via_runtime_check() {
904 /// Unsafely produces the split parts of `self`.
921 // caller has promised that the left and right portions of `self` split
961 /// Produces the split parts of `self`, using [`Immutable`] to ensure that
973 /// Produces the split parts of `self`, using [`IntoBytes`] to ensure that
981 // Consequently, `T` can be split into non-overlapping parts at any
986 /// Produces the split parts of `self` after the conservative layout
1020 /// Produces the split parts of `self`, using a dynamic check to ensure that
1044 /// Unsafely produces the split parts of `self`.
1207 // padding does not constrain this split.
1238 let split = dst.split_at_mut(i).unwrap().via_runtime_check();
1239 assert_eq!(split.is_err(), has_padding);
1240 if let Ok((left, right)) = split {
1346 let split = dst.split_at(i).unwrap().via_runtime_check();
1348 assert!(split.is_ok());
1350 assert!(split.is_err());
1360 let split = unsafe { SplitAt::split_at_unchecked(slice, 2) };
1361 // SAFETY: SplitAt::split_at_unchecked guarantees that the split is valid.
1362 let (l, r) = unsafe { split.via_unchecked() };
1368 let split = unsafe { SplitAt::split_at_mut_unchecked(slice_mut, 2) };
1369 // SAFETY: SplitAt::split_at_mut_unchecked guarantees that the split is valid.
1370 let (l, r) = unsafe { split.via_unchecked() };
1403 fn via_unaligned<'a, T>(split: Split<&'a T>) -> (&'a T, &'a [T::Elem])
1407 split.via_unaligned()
1410 fn via_unaligned_mut<'a, T>(split: Split<&'a mut T>) -> (&'a mut T, &'a mut [T::Elem])
1414 split.via_unaligned()
1429 let split = packet.split_at(2).unwrap();
1430 let (l, r) = via_unaligned(split);
1437 let split = packet.split_at_mut(2).unwrap();
1438 let (l, r) = via_unaligned_mut(split);
1454 let split = SplitAt::split_at(&words[..], 2).unwrap();
1455 let (left, right) = split.via_no_dynamic_padding();
1460 let split = SplitAt::split_at_mut(&mut words[..], 2).unwrap();
1461 let (left, right) = split.via_no_dynamic_padding();
1468 let split = SplitAt::split_at(&cells[..], 2).unwrap();
1469 let (left, right) = split.via_no_dynamic_padding();