Lines Matching refs:T
101 pub struct Vec<T, A: Allocator> {
102 ptr: NonNull<T>,
107 layout: ArrayLayout<T>,
123 pub type KVec<T> = Vec<T, Kmalloc>;
136 pub type VVec<T> = Vec<T, Vmalloc>;
149 pub type KVVec<T> = Vec<T, KVmalloc>;
152 unsafe impl<T, A> Send for Vec<T, A>
154 T: Send,
160 unsafe impl<T, A> Sync for Vec<T, A>
162 T: Sync,
167 impl<T, A> Vec<T, A>
173 core::mem::size_of::<T>() == 0 in is_zst()
215 unsafe fn dec_len(&mut self, count: usize) -> &mut [T] { in dec_len() argument
228 pub fn as_slice(&self) -> &[T] { in as_slice() argument
234 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice() argument
241 pub fn as_mut_ptr(&mut self) -> *mut T { in as_mut_ptr() argument
248 pub fn as_ptr(&self) -> *const T { in as_ptr() argument
287 pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { in spare_capacity_mut() argument
292 let ptr = unsafe { self.as_mut_ptr().add(self.len) }.cast::<MaybeUninit<T>>(); in spare_capacity_mut()
312 pub fn push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> { in push() argument
335 pub fn push_within_capacity(&mut self, v: T) -> Result<(), PushError<T>> { in push_within_capacity() argument
350 unsafe fn push_within_capacity_unchecked(&mut self, v: T) { in push_within_capacity_unchecked() argument
385 element: T, in insert_within_capacity() argument
386 ) -> Result<(), InsertError<T>> { in insert_within_capacity() argument
426 pub fn pop(&mut self) -> Option<T> { in pop() argument
431 let removed: *mut T = { in pop()
452 pub fn remove(&mut self, i: usize) -> Result<T, RemoveError> { in remove() argument
537 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
563 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
668 let ptr: *mut [T] = unsafe { self.dec_len(count) }; in truncate()
690 pub fn drain_all(&mut self) -> DrainAll<'_, T> { in drain_all() argument
710 pub fn retain(&mut self, mut f: impl FnMut(&mut T) -> bool) { in retain()
724 impl<T: Clone, A: Allocator> Vec<T, A> {
726 pub fn extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> { in extend_with() argument
765 pub fn extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> { in extend_from_slice() argument
781 pub fn from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> { in from_elem() argument
806 pub fn resize(&mut self, new_len: usize, value: T, flags: Flags) -> Result<(), AllocError> { in resize() argument
817 impl<T, A> Drop for Vec<T, A>
837 impl<T, A, const N: usize> From<Box<[T; N], A>> for Vec<T, A>
841 fn from(b: Box<[T; N], A>) -> Vec<T, A> { in from() argument
855 impl<T, A: Allocator> Default for Vec<T, A> {
862 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
868 impl<T, A> Deref for Vec<T, A>
872 type Target = [T];
875 fn deref(&self) -> &[T] { in deref() argument
882 impl<T, A> DerefMut for Vec<T, A>
887 fn deref_mut(&mut self) -> &mut [T] { in deref_mut() argument
911 impl<T, A> Borrow<[T]> for Vec<T, A>
915 fn borrow(&self) -> &[T] { in borrow() argument
937 impl<T, A> BorrowMut<[T]> for Vec<T, A>
941 fn borrow_mut(&mut self) -> &mut [T] { in borrow_mut() argument
946 impl<T: Eq, A> Eq for Vec<T, A> where A: Allocator {}
948 impl<T, I: SliceIndex<[T]>, A> Index<I> for Vec<T, A>
960 impl<T, I: SliceIndex<[T]>, A> IndexMut<I> for Vec<T, A>
973 impl<T, U, $($vars)*> PartialEq<$rhs> for $lhs
975 T: PartialEq<U>,
985 [A1: Allocator, A2: Allocator] Vec<T, A1>, Vec<U, A2>,
986 [A: Allocator] Vec<T, A>, &[U],
987 [A: Allocator] Vec<T, A>, &mut [U],
988 [A: Allocator] &[T], Vec<U, A>,
989 [A: Allocator] &mut [T], Vec<U, A>,
990 [A: Allocator] Vec<T, A>, [U],
991 [A: Allocator] [T], Vec<U, A>,
992 [A: Allocator, const N: usize] Vec<T, A>, [U; N],
993 [A: Allocator, const N: usize] Vec<T, A>, &[U; N],
996 impl<'a, T, A> IntoIterator for &'a Vec<T, A>
1000 type Item = &'a T;
1001 type IntoIter = slice::Iter<'a, T>;
1008 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A>
1012 type Item = &'a mut T;
1013 type IntoIter = slice::IterMut<'a, T>;
1033 pub struct IntoIter<T, A: Allocator> {
1034 ptr: *mut T,
1035 buf: NonNull<T>,
1037 layout: ArrayLayout<T>,
1041 impl<T, A> IntoIter<T, A>
1045 fn into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) { in into_raw_parts() argument
1089 pub fn collect(self, flags: Flags) -> Vec<T, A> { in collect() argument
1108 let layout = unsafe { ArrayLayout::<T>::new_unchecked(len) }; in collect()
1137 impl<T, A> Iterator for IntoIter<T, A>
1141 type Item = T;
1156 fn next(&mut self) -> Option<T> { in next() argument
1196 impl<T, A> Drop for IntoIter<T, A>
1211 impl<T, A> IntoIterator for Vec<T, A>
1215 type Item = T;
1216 type IntoIter = IntoIter<T, A>;
1268 pub struct DrainAll<'vec, T> {
1269 elements: slice::IterMut<'vec, T>,
1272 impl<'vec, T> Iterator for DrainAll<'vec, T> {
1273 type Item = T;
1275 fn next(&mut self) -> Option<T> { in next() argument
1276 let elem: *mut T = self.elements.next()?; in next()
1286 impl<'vec, T> Drop for DrainAll<'vec, T> {
1288 if core::mem::needs_drop::<T>() { in drop()
1290 let ptr: *mut [T] = iter.into_slice(); in drop()