Lines Matching full:slice
12 /// Error raised when a projection is attempted on an array or slice out of bounds.
24 /// This is similar to [`core::slice::SliceIndex`], but operates on raw pointers safely and
30 /// input pointer `slice` and returned pointer `output`, then:
31 /// - `output` has the same provenance as `slice`;
32 /// - `output.byte_offset_from(slice)` is between 0 to
33 /// `KnownSize::size(slice) - KnownSize::size(output)`.
43 fn get(self, slice: *mut T) -> Option<*mut Self::Output>; in get()
47 fn index(self, slice: *mut T) -> *mut Self::Output { in index()
48 Self::get(self, slice).unwrap_or_else(|| build_error!()) in index()
52 // Forward array impl to slice impl.
62 fn get(self, slice: *mut [T; N]) -> Option<*mut Self::Output> { in get()
63 <I as ProjectIndex<[T]>>::get(self, slice)
67 fn index(self, slice: *mut [T; N]) -> *mut Self::Output { in index()
68 <I as ProjectIndex<[T]>>::index(self, slice)
72 // SAFETY: `get`-returned pointer has the same provenance as `slice` and the offset is checked to
78 fn get(self, slice: *mut [T]) -> Option<*mut T> { in get()
79 if self >= slice.len() { in get()
82 Some(slice.cast::<T>().wrapping_add(self)) in get()
87 // SAFETY: `get`-returned pointer has the same provenance as `slice` and the offset is checked to
93 fn get(self, slice: *mut [T]) -> Option<*mut [T]> { in get()
95 if self.end > slice.len() { in get()
99 slice.cast::<T>().wrapping_add(self.start), in get()
110 fn get(self, slice: *mut [T]) -> Option<*mut [T]> { in get()
111 (0..self.end).get(slice) in get()
120 fn get(self, slice: *mut [T]) -> Option<*mut [T]> { in get()
121 (self.start..slice.len()).get(slice) in get()
130 fn get(self, slice: *mut [T]) -> Option<*mut [T]> { in get()
131 Some(slice) in get()