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> {
643 pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self { in from_raw_parts() argument
648 impl<T, A: Allocator> Vec<T, A> {
901 pub unsafe fn from_raw_parts_in(ptr: *mut T, length: usize, capacity: usize, alloc: A) -> Self { in from_raw_parts_in() argument
938 pub fn into_raw_parts(self) -> (*mut T, usize, usize) { in into_raw_parts() argument
982 pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A) { in into_raw_parts_with_alloc() argument
1218 pub fn into_boxed_slice(mut self) -> Box<[T], A> { in into_boxed_slice() argument
1306 pub fn as_slice(&self) -> &[T] { in as_slice() argument
1323 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice() argument
1355 pub fn as_ptr(&self) -> *const T { in as_ptr() argument
1388 pub fn as_mut_ptr(&mut self) -> *mut T { in as_mut_ptr() argument
1513 pub fn swap_remove(&mut self, index: usize) -> T { in swap_remove() argument
1554 pub fn insert(&mut self, index: usize, element: T) { in insert() argument
1615 pub fn remove(&mut self, index: usize) -> T { in remove() argument
1672 F: FnMut(&T) -> bool, in retain()
1698 F: FnMut(&mut T) -> bool, in retain_mut()
1716 struct BackshiftOnDrop<'a, T, A: Allocator> { in retain_mut()
1717 v: &'a mut Vec<T, A>, in retain_mut()
1723 impl<T, A: Allocator> Drop for BackshiftOnDrop<'_, T, A> { in retain_mut()
1744 fn process_loop<F, T, A: Allocator, const DELETED: bool>( in retain_mut() argument
1747 g: &mut BackshiftOnDrop<'_, T, A>, in retain_mut()
1749 F: FnMut(&mut T) -> bool, in retain_mut()
1780 process_loop::<F, T, A, false>(original_len, &mut f, &mut g); in retain_mut()
1783 process_loop::<F, T, A, true>(original_len, &mut f, &mut g); in retain_mut()
1807 F: FnMut(&mut T) -> K, in dedup_by_key()
1834 F: FnMut(&mut T, &mut T) -> bool, in dedup_by() argument
1842 struct FillGapOnDrop<'a, T, A: core::alloc::Allocator> { in dedup_by()
1851 vec: &'a mut Vec<T, A>, in dedup_by()
1854 impl<'a, T, A: core::alloc::Allocator> Drop for FillGapOnDrop<'a, T, A> { in dedup_by()
1943 pub fn push(&mut self, value: T) { in push() argument
1967 pub fn try_push(&mut self, value: T) -> Result<(), TryReserveError> { in try_push()
2012 pub fn push_within_capacity(&mut self, value: T) -> Result<(), T> { in push_within_capacity() argument
2041 pub fn pop(&mut self) -> Option<T> { in pop() argument
2080 unsafe fn append_elements(&mut self, other: *const [T]) { in append_elements() argument
2084 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; in append_elements() constant
2090 unsafe fn try_append_elements(&mut self, other: *const [T]) -> Result<(), TryReserveError> { in try_append_elements()
2094 unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; in try_append_elements() constant
2130 pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A> in drain() argument
2177 let elems: *mut [T] = self.as_mut_slice(); in clear()
2309 F: FnMut() -> T, in resize_with() argument
2344 pub fn leak<'a>(self) -> &'a mut [T] in leak()
2382 pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] { in spare_capacity_mut() argument
2388 self.as_mut_ptr().add(self.len) as *mut MaybeUninit<T>, in spare_capacity_mut()
2447 pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) { in split_at_spare_mut() argument
2459 ) -> (&mut [T], &mut [MaybeUninit<T>], &mut usize) { in split_at_spare_mut_with_len() argument
2466 let spare_ptr = spare_ptr.cast::<MaybeUninit<T>>(); in split_at_spare_mut_with_len()
2481 impl<T: Clone, A: Allocator> Vec<T, A> {
2507 pub fn resize(&mut self, new_len: usize, value: T) { in resize() argument
2545 pub fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), TryReserveError> { in try_resize()
2577 pub fn extend_from_slice(&mut self, other: &[T]) { in extend_from_slice() argument
2601 pub fn try_extend_from_slice(&mut self, other: &[T]) -> Result<(), TryReserveError> { in try_extend_from_slice()
2643 impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
2666 pub fn into_flattened(self) -> Vec<T, A> { in into_flattened() argument
2668 let (new_len, new_cap) = if T::IS_ZST { in into_flattened()
2684 unsafe { Vec::<T, A>::from_raw_parts_in(ptr.cast(), new_len, new_cap, alloc) } in into_flattened()
2688 impl<T: Clone, A: Allocator> Vec<T, A> {
2691 fn extend_with(&mut self, n: usize, value: T) { in extend_with() argument
2720 fn try_extend_with(&mut self, n: usize, value: T) -> Result<(), TryReserveError> { in try_extend_with()
2750 impl<T: PartialEq, A: Allocator> Vec<T, A> {
2779 pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> { in from_elem() argument
2780 <T as SpecFromElem>::from_elem(elem, n, Global) in from_elem()
2786 pub fn from_elem_in<T: Clone, A: Allocator>(elem: T, n: usize, alloc: A) -> Vec<T, A> { in from_elem_in() argument
2787 <T as SpecFromElem>::from_elem(elem, n, alloc) in from_elem_in()
2798 impl<T: Clone, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2817 impl<T: Copy, A: Allocator> ExtendFromWithinSpec for Vec<T, A> {
2850 impl<T, A: Allocator> ops::Deref for Vec<T, A> {
2851 type Target = [T];
2854 fn deref(&self) -> &[T] { in deref() argument
2860 impl<T, A: Allocator> ops::DerefMut for Vec<T, A> {
2862 fn deref_mut(&mut self) -> &mut [T] { in deref_mut() argument
2869 impl<T: Clone, A: Allocator + Clone> Clone for Vec<T, A> {
2873 <[T]>::to_vec_in(&**self, alloc) in clone()
2903 impl<T: Hash, A: Allocator> Hash for Vec<T, A> {
2915 impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> {
2929 impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
2938 impl<T> FromIterator<T> for Vec<T> {
2940 fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Vec<T> { in from_iter()
2941 <Self as SpecFromIter<T, I::IntoIter>>::from_iter(iter.into_iter()) in from_iter()
2946 impl<T, A: Allocator> IntoIterator for Vec<T, A> {
2947 type Item = T;
2948 type IntoIter = IntoIter<T, A>;
2972 let end = if T::IS_ZST { in into_iter()
2975 begin.add(me.len()) as *const T in into_iter() constant
2991 impl<'a, T, A: Allocator> IntoIterator for &'a Vec<T, A> {
2992 type Item = &'a T;
2993 type IntoIter = slice::Iter<'a, T>;
3001 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> {
3002 type Item = &'a mut T;
3003 type IntoIter = slice::IterMut<'a, T>;
3012 impl<T, A: Allocator> Extend<T> for Vec<T, A> {
3014 fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) { in extend()
3015 <Self as SpecExtend<T, I::IntoIter>>::spec_extend(self, iter.into_iter()) in extend()
3019 fn extend_one(&mut self, item: T) { in extend_one() argument
3029 impl<T, A: Allocator> Vec<T, A> {
3033 fn extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) { in extend_desugared()
3059 …fn try_extend_desugared<I: Iterator<Item = T>>(&mut self, mut iterator: I) -> Result<(), TryReserv… in try_extend_desugared()
3088 fn extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) { in extend_trusted()
3121 …fn try_extend_trusted(&mut self, iterator: impl iter::TrustedLen<Item = T>) -> Result<(), TryReser… in try_extend_trusted()
3187 I: IntoIterator<Item = T>, in splice()
3243 pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A> in extract_if() argument
3245 F: FnMut(&mut T) -> bool, in extract_if()
3266 impl<'a, T: Copy + 'a, A: Allocator> Extend<&'a T> for Vec<T, A> {
3267 fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) { in extend()
3272 fn extend_one(&mut self, &item: &'a T) { in extend_one() argument
3284 impl<T, A1, A2> PartialOrd<Vec<T, A2>> for Vec<T, A1>
3286 T: PartialOrd,
3291 fn partial_cmp(&self, other: &Vec<T, A2>) -> Option<Ordering> { in partial_cmp() argument
3297 impl<T: Eq, A: Allocator> Eq for Vec<T, A> {}
3301 impl<T: Ord, A: Allocator> Ord for Vec<T, A> {
3309 unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec<T, A> {
3322 impl<T> Default for Vec<T> {
3326 fn default() -> Vec<T> { in default()
3332 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
3339 impl<T, A: Allocator> AsRef<Vec<T, A>> for Vec<T, A> {
3340 fn as_ref(&self) -> &Vec<T, A> { in as_ref() argument
3346 impl<T, A: Allocator> AsMut<Vec<T, A>> for Vec<T, A> {
3347 fn as_mut(&mut self) -> &mut Vec<T, A> { in as_mut() argument
3353 impl<T, A: Allocator> AsRef<[T]> for Vec<T, A> {
3354 fn as_ref(&self) -> &[T] { in as_ref() argument
3360 impl<T, A: Allocator> AsMut<[T]> for Vec<T, A> {
3361 fn as_mut(&mut self) -> &mut [T] { in as_mut() argument
3368 impl<T: Clone> From<&[T]> for Vec<T> {
3377 fn from(s: &[T]) -> Vec<T> { in from() argument
3381 fn from(s: &[T]) -> Vec<T> { in from() argument
3388 impl<T: Clone> From<&mut [T]> for Vec<T> {
3397 fn from(s: &mut [T]) -> Vec<T> { in from() argument
3401 fn from(s: &mut [T]) -> Vec<T> { in from() argument
3408 impl<T, const N: usize> From<[T; N]> for Vec<T> {
3417 fn from(s: [T; N]) -> Vec<T> { in from() argument
3418 <[T]>::into_vec(Box::new(s))
3422 fn from(s: [T; N]) -> Vec<T> { in from() argument
3429 impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
3431 [T]: ToOwned<Owned = Vec<T>>,
3447 fn from(s: Cow<'a, [T]>) -> Vec<T> { in from() argument
3455 impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
3465 fn from(s: Box<[T], A>) -> Self { in from() argument
3474 impl<T, A: Allocator> From<Vec<T, A>> for Box<[T], A> {
3493 fn from(v: Vec<T, A>) -> Self { in from() argument
3514 impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
3515 type Error = Vec<T, A>;
3543 fn try_from(mut vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>> { in try_from() argument
3556 let array = unsafe { ptr::read(vec.as_ptr() as *const [T; N]) };