Lines Matching refs:T

402 pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
403 buf: RawVec<T, A>,
411 impl<T> Vec<T> {
545 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
550 impl<T, A: Allocator> Vec<T, A> {
692 pub unsafe fn from_raw_parts_in(ptr: *mut T, length: usize, capacity: usize, alloc: A) -> Self { in from_raw_parts_in() argument
729 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
773 pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A) { in into_raw_parts_with_alloc() argument
1003 pub fn into_boxed_slice(mut self) -> Box<[T], A> { in into_boxed_slice() argument
1091 pub fn as_slice(&self) -> &[T] { in as_slice() argument
1108 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice() argument
1139 pub fn as_ptr(&self) -> *const T { in as_ptr() argument
1175 pub fn as_mut_ptr(&mut self) -> *mut T { in as_mut_ptr() argument
1304 pub fn swap_remove(&mut self, index: usize) -> T { in swap_remove() argument
1345 pub fn insert(&mut self, index: usize, element: T) { in insert() argument
1403 pub fn remove(&mut self, index: usize) -> T { in remove() argument
1460 F: FnMut(&T) -> bool, in retain()
1486 F: FnMut(&mut T) -> bool, in retain_mut()
1504 struct BackshiftOnDrop<'a, T, A: Allocator> { in retain_mut()
1505 v: &'a mut Vec<T, A>, in retain_mut()
1511 impl<T, A: Allocator> Drop for BackshiftOnDrop<'_, T, A> { in retain_mut()
1532 fn process_loop<F, T, A: Allocator, const DELETED: bool>( in retain_mut() argument
1535 g: &mut BackshiftOnDrop<'_, T, A>, in retain_mut()
1537 F: FnMut(&mut T) -> bool, in retain_mut()
1568 process_loop::<F, T, A, false>(original_len, &mut f, &mut g); in retain_mut()
1571 process_loop::<F, T, A, true>(original_len, &mut f, &mut g); in retain_mut()
1595 F: FnMut(&mut T) -> K, in dedup_by_key()
1622 F: FnMut(&mut T, &mut T) -> bool, in dedup_by() argument
1630 struct FillGapOnDrop<'a, T, A: core::alloc::Allocator> { in dedup_by()
1639 vec: &'a mut Vec<T, A>, in dedup_by()
1642 impl<'a, T, A: core::alloc::Allocator> Drop for FillGapOnDrop<'a, T, A> { in dedup_by()
1731 pub fn push(&mut self, value: T) { in push() argument
1755 pub fn try_push(&mut self, value: T) -> Result<(), TryReserveError> { in try_push()
1784 pub fn pop(&mut self) -> Option<T> { in pop() argument
1823 unsafe fn append_elements(&mut self, other: *const [T]) { in append_elements() argument
1827 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; in append_elements()
1862 pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A> in drain() argument
1911 let elems: *mut [T] = self.as_mut_slice(); in clear()
2043 F: FnMut() -> T, in resize_with() argument
2079 pub fn leak<'a>(self) -> &'a mut [T] in leak()
2117 pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { in spare_capacity_mut() argument
2123 self.as_mut_ptr().add(self.len) as *mut MaybeUninit<T>, in spare_capacity_mut()
2182 pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) { in split_at_spare_mut() argument
2194 ) -> (&mut [T], &mut [MaybeUninit<T>], &mut usize) { in split_at_spare_mut_with_len() argument
2201 let spare_ptr = spare_ptr.cast::<MaybeUninit<T>>(); in split_at_spare_mut_with_len()
2216 impl<T: Clone, A: Allocator> Vec<T, A> {
2242 pub fn resize(&mut self, new_len: usize, value: T) { in resize() argument
2273 pub fn extend_from_slice(&mut self, other: &[T]) { in extend_from_slice() argument
2315 impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
2338 pub fn into_flattened(self) -> Vec<T, A> { in into_flattened() argument
2340 let (new_len, new_cap) = if mem::size_of::<T>() == 0 { in into_flattened()
2356 unsafe { Vec::<T, A>::from_raw_parts_in(ptr.cast(), new_len, new_cap, alloc) } in into_flattened()
2361 trait ExtendWith<T> {
2362 fn next(&mut self) -> T; in next() argument
2363 fn last(self) -> T; in last() argument
2366 struct ExtendElement<T>(T);
2367 impl<T: Clone> ExtendWith<T> for ExtendElement<T> {
2368 fn next(&mut self) -> T { in next() argument
2371 fn last(self) -> T { in last() argument
2377 impl<T, F: FnMut() -> T> ExtendWith<T> for ExtendFunc<F> { impl
2378 fn next(&mut self) -> T { in next() argument
2381 fn last(mut self) -> T { in last() argument
2386 impl<T, A: Allocator> Vec<T, A> {
2389 fn extend_with<E: ExtendWith<T>>(&mut self, n: usize, mut value: E) { in extend_with()
2418 impl<T: PartialEq, A: Allocator> Vec<T, A> {
2447 pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> { in from_elem() argument
2448 <T as SpecFromElem>::from_elem(elem, n, Global) in from_elem()
2454 pub fn from_elem_in<T: Clone, A: Allocator>(elem: T, n: usize, alloc: A) -> Vec<T, A> { in from_elem_in() argument
2455 <T as SpecFromElem>::from_elem(elem, n, alloc) in from_elem_in()
2466 impl<T: Clone, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2485 impl<T: Copy, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2518 impl<T, A: Allocator> ops::Deref for Vec<T, A> {
2519 type Target = [T];
2521 fn deref(&self) -> &[T] { in deref() argument
2527 impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
2528 fn deref_mut(&mut self) -> &mut [T] { in deref_mut() argument
2539 impl<T: Clone, A: Allocator> SpecCloneFrom for Vec<T, A> {
2555 impl<T: Copy, A: Allocator> SpecCloneFrom for Vec<T, A> {
2564 impl<T: Clone, A: Allocator + Clone> Clone for Vec<T, A> {
2568 <[T]>::to_vec_in(&**self, alloc) in clone()
2599 impl<T: Hash, A: Allocator> Hash for Vec<T, A> {
2611 impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> {
2625 impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
2634 impl<T> FromIterator<T> for Vec<T> {
2636 fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Vec<T> { in from_iter()
2637 <Self as SpecFromIter<T, I::IntoIter>>::from_iter(iter.into_iter()) in from_iter()
2642 impl<T, A: Allocator> IntoIterator for Vec<T, A> {
2643 type Item = T;
2644 type IntoIter = IntoIter<T, A>;
2660 fn into_iter(self) -> IntoIter<T, A> { in into_iter() argument
2665 let end = if mem::size_of::<T>() == 0 { in into_iter()
2666 arith_offset(begin as *const i8, me.len() as isize) as *const T in into_iter()
2668 begin.add(me.len()) as *const T in into_iter()
2684 impl<'a, T, A: Allocator> IntoIterator for &'a Vec<T, A> {
2685 type Item = &'a T;
2686 type IntoIter = slice::Iter<'a, T>;
2688 fn into_iter(self) -> slice::Iter<'a, T> { in into_iter() argument
2694 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> {
2695 type Item = &'a mut T;
2696 type IntoIter = slice::IterMut<'a, T>;
2698 fn into_iter(self) -> slice::IterMut<'a, T> { in into_iter() argument
2705 impl<T, A: Allocator> Extend<T> for Vec<T, A> {
2707 fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) { in extend()
2708 <Self as SpecExtend<T, I::IntoIter>>::spec_extend(self, iter.into_iter()) in extend()
2712 fn extend_one(&mut self, item: T) { in extend_one() argument
2722 impl<T, A: Allocator> Vec<T, A> {
2726 fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) { in extend_desugared()
2789 I: IntoIterator<Item = T>, in splice()
2839 pub fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<'_, T, F, A> in drain_filter() argument
2841 F: FnMut(&mut T) -> bool, in drain_filter()
2862 impl<'a, T: Copy + 'a, A: Allocator + 'a> Extend<&'a T> for Vec<T, A> {
2863 fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) { in extend()
2868 fn extend_one(&mut self, &item: &'a T) { in extend_one() argument
2880 impl<T: PartialOrd, A: Allocator> PartialOrd for Vec<T, A> {
2888 impl<T: Eq, A: Allocator> Eq for Vec<T, A> {}
2892 impl<T: Ord, A: Allocator> Ord for Vec<T, A> {
2900 unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec<T, A> {
2914 impl<T> const Default for Vec<T> {
2916 fn default() -> Vec<T> { in default()
2922 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
2929 impl<T, A: Allocator> AsRef<Vec<T, A>> for Vec<T, A> {
2930 fn as_ref(&self) -> &Vec<T, A> { in as_ref() argument
2936 impl<T, A: Allocator> AsMut<Vec<T, A>> for Vec<T, A> {
2937 fn as_mut(&mut self) -> &mut Vec<T, A> { in as_mut() argument
2943 impl<T, A: Allocator> AsRef<[T]> for Vec<T, A> {
2944 fn as_ref(&self) -> &[T] { in as_ref() argument
2950 impl<T, A: Allocator> AsMut<[T]> for Vec<T, A> {
2951 fn as_mut(&mut self) -> &mut [T] { in as_mut() argument
2958 impl<T: Clone> From<&[T]> for Vec<T> {
2967 fn from(s: &[T]) -> Vec<T> { in from() argument
2971 fn from(s: &[T]) -> Vec<T> { in from() argument
2978 impl<T: Clone> From<&mut [T]> for Vec<T> {
2987 fn from(s: &mut [T]) -> Vec<T> { in from() argument
2991 fn from(s: &mut [T]) -> Vec<T> { in from() argument
2998 impl<T, const N: usize> From<[T; N]> for Vec<T> {
3007 fn from(s: [T; N]) -> Vec<T> { in from() argument
3008 <[T]>::into_vec(box s)
3012 fn from(s: [T; N]) -> Vec<T> { in from() argument
3018 impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
3020 [T]: ToOwned<Owned = Vec<T>>,
3036 fn from(s: Cow<'a, [T]>) -> Vec<T> { in from() argument
3044 impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
3054 fn from(s: Box<[T], A>) -> Self { in from() argument
3063 impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A> {
3074 fn from(v: Vec<T, A>) -> Self { in from() argument
3095 impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
3096 type Error = Vec<T, A>;
3124 fn try_from(mut vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>> { in try_from() argument
3137 let array = unsafe { ptr::read(vec.as_ptr() as *const [T; N]) };