Lines Matching refs:T

104 pub struct Vec<T, A: Allocator> {
105 ptr: NonNull<T>,
110 layout: ArrayLayout<T>,
126 pub type KVec<T> = Vec<T, Kmalloc>;
139 pub type VVec<T> = Vec<T, Vmalloc>;
152 pub type KVVec<T> = Vec<T, KVmalloc>;
155 unsafe impl<T, A> Send for Vec<T, A>
157 T: Send,
163 unsafe impl<T, A> Sync for Vec<T, A>
165 T: Sync,
170 impl<T, A> Vec<T, A>
176 core::mem::size_of::<T>() == 0 in is_zst()
218 unsafe fn dec_len(&mut self, count: usize) -> &mut [T] { in dec_len() argument
241 pub fn as_slice(&self) -> &[T] { in as_slice() argument
247 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice() argument
254 pub fn as_mut_ptr(&mut self) -> *mut T { in as_mut_ptr() argument
261 pub const fn as_ptr(&self) -> *const T { in as_ptr() argument
300 pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { in spare_capacity_mut() argument
305 let ptr = unsafe { self.as_mut_ptr().add(self.len) }.cast::<MaybeUninit<T>>(); in spare_capacity_mut()
325 pub fn push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> { in push() argument
348 pub fn push_within_capacity(&mut self, v: T) -> Result<(), PushError<T>> { in push_within_capacity() argument
363 unsafe fn push_within_capacity_unchecked(&mut self, v: T) { in push_within_capacity_unchecked() argument
398 element: T, in insert_within_capacity() argument
399 ) -> Result<(), InsertError<T>> { in insert_within_capacity() argument
439 pub fn pop(&mut self) -> Option<T> { in pop() argument
444 let removed: *mut T = { in pop()
465 pub fn remove(&mut self, i: usize) -> Result<T, RemoveError> { in remove() argument
550 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
576 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
682 let ptr: *mut [T] = unsafe { self.dec_len(count) }; in truncate()
704 pub fn drain_all(&mut self) -> DrainAll<'_, T> { in drain_all() argument
724 pub fn retain(&mut self, mut f: impl FnMut(&mut T) -> bool) { in retain()
738 impl<T: Clone, A: Allocator> Vec<T, A> {
740 pub fn extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> { in extend_with() argument
779 pub fn extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> { in extend_from_slice() argument
795 pub fn from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> { in from_elem() argument
820 pub fn resize(&mut self, new_len: usize, value: T, flags: Flags) -> Result<(), AllocError> { in resize() argument
831 impl<T, A> Drop for Vec<T, A>
851 impl<T, A, const N: usize> From<Box<[T; N], A>> for Vec<T, A>
855 fn from(b: Box<[T; N], A>) -> Vec<T, A> { in from() argument
869 impl<T, A: Allocator> Default for Vec<T, A> {
876 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
882 impl<T, A> Deref for Vec<T, A>
886 type Target = [T];
889 fn deref(&self) -> &[T] { in deref() argument
896 impl<T, A> DerefMut for Vec<T, A>
901 fn deref_mut(&mut self) -> &mut [T] { in deref_mut() argument
925 impl<T, A> Borrow<[T]> for Vec<T, A>
929 fn borrow(&self) -> &[T] { in borrow() argument
951 impl<T, A> BorrowMut<[T]> for Vec<T, A>
955 fn borrow_mut(&mut self) -> &mut [T] { in borrow_mut() argument
960 impl<T: Eq, A> Eq for Vec<T, A> where A: Allocator {}
962 impl<T, I: SliceIndex<[T]>, A> Index<I> for Vec<T, A>
974 impl<T, I: SliceIndex<[T]>, A> IndexMut<I> for Vec<T, A>
987 impl<T, U, $($vars)*> PartialEq<$rhs> for $lhs
989 T: PartialEq<U>,
999 [A1: Allocator, A2: Allocator] Vec<T, A1>, Vec<U, A2>,
1000 [A: Allocator] Vec<T, A>, &[U],
1001 [A: Allocator] Vec<T, A>, &mut [U],
1002 [A: Allocator] &[T], Vec<U, A>,
1003 [A: Allocator] &mut [T], Vec<U, A>,
1004 [A: Allocator] Vec<T, A>, [U],
1005 [A: Allocator] [T], Vec<U, A>,
1006 [A: Allocator, const N: usize] Vec<T, A>, [U; N],
1007 [A: Allocator, const N: usize] Vec<T, A>, &[U; N],
1010 impl<'a, T, A> IntoIterator for &'a Vec<T, A>
1014 type Item = &'a T;
1015 type IntoIter = slice::Iter<'a, T>;
1022 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A>
1026 type Item = &'a mut T;
1027 type IntoIter = slice::IterMut<'a, T>;
1053 impl<T> AsPageIter for VVec<T> {
1057 T: 'a;
1084 pub struct IntoIter<T, A: Allocator> {
1085 ptr: *mut T,
1086 buf: NonNull<T>,
1088 layout: ArrayLayout<T>,
1092 impl<T, A> IntoIter<T, A>
1096 fn into_raw_parts(self) -> (*mut T, NonNull<T>, usize, usize) { in into_raw_parts() argument
1140 pub fn collect(self, flags: Flags) -> Vec<T, A> { in collect() argument
1159 let layout = unsafe { ArrayLayout::<T>::new_unchecked(len) }; in collect()
1194 impl<T, A> Iterator for IntoIter<T, A>
1198 type Item = T;
1213 fn next(&mut self) -> Option<T> { in next() argument
1253 impl<T, A> Drop for IntoIter<T, A>
1268 impl<T, A> IntoIterator for Vec<T, A>
1272 type Item = T;
1273 type IntoIter = IntoIter<T, A>;
1325 pub struct DrainAll<'vec, T> {
1326 elements: slice::IterMut<'vec, T>,
1329 impl<'vec, T> Iterator for DrainAll<'vec, T> {
1330 type Item = T;
1332 fn next(&mut self) -> Option<T> { in next() argument
1333 let elem: *mut T = self.elements.next()?; in next()
1343 impl<'vec, T> Drop for DrainAll<'vec, T> {
1345 if core::mem::needs_drop::<T>() { in drop()
1347 let ptr: *mut [T] = iter.into_slice(); in drop()