Lines Matching refs:T
399 pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
400 buf: RawVec<T, A>,
408 impl<T> Vec<T> {
645 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
650 impl<T, A: Allocator> Vec<T, A> {
900 pub unsafe fn from_raw_parts_in(ptr: *mut T, length: usize, capacity: usize, alloc: A) -> Self { in from_raw_parts_in() argument
937 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
981 pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A) { in into_raw_parts_with_alloc() argument
1217 pub fn into_boxed_slice(mut self) -> Box<[T], A> { in into_boxed_slice() argument
1305 pub fn as_slice(&self) -> &[T] { in as_slice() argument
1322 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice() argument
1354 pub fn as_ptr(&self) -> *const T { in as_ptr() argument
1387 pub fn as_mut_ptr(&mut self) -> *mut T { in as_mut_ptr() argument
1512 pub fn swap_remove(&mut self, index: usize) -> T { in swap_remove() argument
1553 pub fn insert(&mut self, index: usize, element: T) { in insert() argument
1614 pub fn remove(&mut self, index: usize) -> T { in remove() argument
1671 F: FnMut(&T) -> bool, in retain()
1697 F: FnMut(&mut T) -> bool, in retain_mut()
1715 struct BackshiftOnDrop<'a, T, A: Allocator> { in retain_mut()
1716 v: &'a mut Vec<T, A>, in retain_mut()
1722 impl<T, A: Allocator> Drop for BackshiftOnDrop<'_, T, A> { in retain_mut()
1743 fn process_loop<F, T, A: Allocator, const DELETED: bool>( in retain_mut() argument
1746 g: &mut BackshiftOnDrop<'_, T, A>, in retain_mut()
1748 F: FnMut(&mut T) -> bool, in retain_mut()
1779 process_loop::<F, T, A, false>(original_len, &mut f, &mut g); in retain_mut()
1782 process_loop::<F, T, A, true>(original_len, &mut f, &mut g); in retain_mut()
1806 F: FnMut(&mut T) -> K, in dedup_by_key()
1833 F: FnMut(&mut T, &mut T) -> bool, in dedup_by() argument
1841 struct FillGapOnDrop<'a, T, A: core::alloc::Allocator> { in dedup_by()
1850 vec: &'a mut Vec<T, A>, in dedup_by()
1853 impl<'a, T, A: core::alloc::Allocator> Drop for FillGapOnDrop<'a, T, A> { in dedup_by()
1942 pub fn push(&mut self, value: T) { in push() argument
1966 pub fn try_push(&mut self, value: T) -> Result<(), TryReserveError> { in try_push()
2011 pub fn push_within_capacity(&mut self, value: T) -> Result<(), T> { in push_within_capacity() argument
2040 pub fn pop(&mut self) -> Option<T> { in pop() argument
2079 unsafe fn append_elements(&mut self, other: *const [T]) { in append_elements() argument
2083 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; in append_elements()
2089 unsafe fn try_append_elements(&mut self, other: *const [T]) -> Result<(), TryReserveError> { in try_append_elements()
2093 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; in try_append_elements()
2129 pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A> in drain() argument
2176 let elems: *mut [T] = self.as_mut_slice(); in clear()
2308 F: FnMut() -> T, in resize_with() argument
2343 pub fn leak<'a>(self) -> &'a mut [T] in leak()
2381 pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { in spare_capacity_mut() argument
2387 self.as_mut_ptr().add(self.len) as *mut MaybeUninit<T>, in spare_capacity_mut()
2446 pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) { in split_at_spare_mut() argument
2458 ) -> (&mut [T], &mut [MaybeUninit<T>], &mut usize) { in split_at_spare_mut_with_len() argument
2465 let spare_ptr = spare_ptr.cast::<MaybeUninit<T>>(); in split_at_spare_mut_with_len()
2480 impl<T: Clone, A: Allocator> Vec<T, A> {
2506 pub fn resize(&mut self, new_len: usize, value: T) { in resize() argument
2544 pub fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError> { in try_resize()
2576 pub fn extend_from_slice(&mut self, other: &[T]) { in extend_from_slice() argument
2600 pub fn try_extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> { in try_extend_from_slice()
2642 impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
2665 pub fn into_flattened(self) -> Vec<T, A> { in into_flattened() argument
2667 let (new_len, new_cap) = if T::IS_ZST { in into_flattened()
2683 unsafe { Vec::<T, A>::from_raw_parts_in(ptr.cast(), new_len, new_cap, alloc) } in into_flattened()
2688 trait ExtendWith<T> {
2689 fn next(&mut self) -> T; in next() argument
2690 fn last(self) -> T; in last() argument
2693 struct ExtendElement<T>(T);
2694 impl<T: Clone> ExtendWith<T> for ExtendElement<T> {
2695 fn next(&mut self) -> T { in next() argument
2698 fn last(self) -> T { in last() argument
2703 impl<T, A: Allocator> Vec<T, A> {
2706 fn extend_with<E: ExtendWith<T>>(&mut self, n: usize, mut value: E) { in extend_with()
2735 …fn try_extend_with<E: ExtendWith<T>>(&mut self, n: usize, mut value: E) -> Result<(), TryReserveEr… in try_extend_with()
2765 impl<T: PartialEq, A: Allocator> Vec<T, A> {
2794 pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> { in from_elem() argument
2795 <T as SpecFromElem>::from_elem(elem, n, Global) in from_elem()
2801 pub fn from_elem_in<T: Clone, A: Allocator>(elem: T, n: usize, alloc: A) -> Vec<T, A> { in from_elem_in() argument
2802 <T as SpecFromElem>::from_elem(elem, n, alloc) in from_elem_in()
2813 impl<T: Clone, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2832 impl<T: Copy, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2865 impl<T, A: Allocator> ops::Deref for Vec<T, A> {
2866 type Target = [T];
2869 fn deref(&self) -> &[T] { in deref() argument
2875 impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
2877 fn deref_mut(&mut self) -> &mut [T] { in deref_mut() argument
2884 impl<T: Clone, A: Allocator + Clone> Clone for Vec<T, A> {
2888 <[T]>::to_vec_in(&**self, alloc) in clone()
2918 impl<T: Hash, A: Allocator> Hash for Vec<T, A> {
2930 impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> {
2944 impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
2953 impl<T> FromIterator<T> for Vec<T> {
2955 fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Vec<T> { in from_iter()
2956 <Self as SpecFromIter<T, I::IntoIter>>::from_iter(iter.into_iter()) in from_iter()
2961 impl<T, A: Allocator> IntoIterator for Vec<T, A> {
2962 type Item = T;
2963 type IntoIter = IntoIter<T, A>;
2987 let end = if T::IS_ZST { in into_iter()
2990 begin.add(me.len()) as *const T in into_iter()
3006 impl<'a, T, A: Allocator> IntoIterator for &'a Vec<T, A> {
3007 type Item = &'a T;
3008 type IntoIter = slice::Iter<'a, T>;
3016 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> {
3017 type Item = &'a mut T;
3018 type IntoIter = slice::IterMut<'a, T>;
3027 impl<T, A: Allocator> Extend<T> for Vec<T, A> {
3029 fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) { in extend()
3030 <Self as SpecExtend<T, I::IntoIter>>::spec_extend(self, iter.into_iter()) in extend()
3034 fn extend_one(&mut self, item: T) { in extend_one() argument
3044 impl<T, A: Allocator> Vec<T, A> {
3048 fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) { in extend_desugared()
3074 …fn try_extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) -> Result<(), TryReserv… in try_extend_desugared()
3103 fn extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) { in extend_trusted()
3136 …fn try_extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) -> Result<(), TryReser… in try_extend_trusted()
3202 I: IntoIterator<Item = T>, in splice()
3252 pub fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<'_, T, F, A> in drain_filter() argument
3254 F: FnMut(&mut T) -> bool, in drain_filter()
3275 impl<'a, T: Copy + 'a, A: Allocator + 'a> Extend<&'a T> for Vec<T, A> {
3276 fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) { in extend()
3281 fn extend_one(&mut self, &item: &'a T) { in extend_one() argument
3293 impl<T: PartialOrd, A: Allocator> PartialOrd for Vec<T, A> {
3301 impl<T: Eq, A: Allocator> Eq for Vec<T, A> {}
3305 impl<T: Ord, A: Allocator> Ord for Vec<T, A> {
3313 unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec<T, A> {
3326 impl<T> Default for Vec<T> {
3330 fn default() -> Vec<T> { in default()
3336 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
3343 impl<T, A: Allocator> AsRef<Vec<T, A>> for Vec<T, A> {
3344 fn as_ref(&self) -> &Vec<T, A> { in as_ref() argument
3350 impl<T, A: Allocator> AsMut<Vec<T, A>> for Vec<T, A> {
3351 fn as_mut(&mut self) -> &mut Vec<T, A> { in as_mut() argument
3357 impl<T, A: Allocator> AsRef<[T]> for Vec<T, A> {
3358 fn as_ref(&self) -> &[T] { in as_ref() argument
3364 impl<T, A: Allocator> AsMut<[T]> for Vec<T, A> {
3365 fn as_mut(&mut self) -> &mut [T] { in as_mut() argument
3372 impl<T: Clone> From<&[T]> for Vec<T> {
3381 fn from(s: &[T]) -> Vec<T> { in from() argument
3385 fn from(s: &[T]) -> Vec<T> { in from() argument
3392 impl<T: Clone> From<&mut [T]> for Vec<T> {
3401 fn from(s: &mut [T]) -> Vec<T> { in from() argument
3405 fn from(s: &mut [T]) -> Vec<T> { in from() argument
3412 impl<T, const N: usize> From<[T; N]> for Vec<T> {
3421 fn from(s: [T; N]) -> Vec<T> { in from() argument
3422 <[T]>::into_vec(Box::new(s))
3426 fn from(s: [T; N]) -> Vec<T> { in from() argument
3433 impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
3435 [T]: ToOwned<Owned = Vec<T>>,
3451 fn from(s: Cow<'a, [T]>) -> Vec<T> { in from() argument
3459 impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
3469 fn from(s: Box<[T], A>) -> Self { in from() argument
3478 impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A> {
3497 fn from(v: Vec<T, A>) -> Self { in from() argument
3518 impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
3519 type Error = Vec<T, A>;
3547 fn try_from(mut vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>> { in try_from() argument
3560 let array = unsafe { ptr::read(vec.as_ptr() as *const [T; N]) };