Lines Matching refs:Box
199 pub struct Box< struct
204 impl<T> Box<T> { implementation
221 Box::new(x) in new()
246 pub fn new_uninit() -> Box<mem::MaybeUninit<T>> { in new_uninit()
272 pub fn new_zeroed() -> Box<mem::MaybeUninit<T>> { in new_zeroed()
287 pub fn pin(x: T) -> Pin<Box<T>> { in pin()
288 Box::new(x).into() in pin()
333 pub fn try_new_uninit() -> Result<Box<mem::MaybeUninit<T>>, AllocError> { in try_new_uninit()
334 Box::try_new_uninit_in(Global) in try_new_uninit()
359 pub fn try_new_zeroed() -> Result<Box<mem::MaybeUninit<T>>, AllocError> { in try_new_zeroed()
360 Box::try_new_zeroed_in(Global) in try_new_zeroed()
364 impl<T, A: Allocator> Box<T, A> { implementation
445 pub fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_uninit_in()
452 match Box::try_new_uninit_in(alloc) { in new_uninit_in()
482 pub fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_uninit_in()
488 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_uninit_in()
515 pub fn new_zeroed_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_zeroed_in()
522 match Box::try_new_zeroed_in(alloc) { in new_zeroed_in()
552 pub fn try_new_zeroed_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_zeroed_in()
558 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_zeroed_in()
583 pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> { in into_boxed_slice()
584 let (raw, alloc) = Box::into_raw_with_allocator(boxed); in into_boxed_slice()
585 unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) } in into_boxed_slice()
606 impl<T> Box<[T]> { implementation
630 pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_uninit_slice()
655 pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_zeroed_slice()
681 pub fn try_new_uninit_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_uninit_slice()
713 pub fn try_new_zeroed_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_zeroed_slice()
725 impl<T, A: Allocator> Box<[T], A> { implementation
752 pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_uninit_slice_in()
780 pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_zeroed_slice_in()
785 impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> { impl
816 pub unsafe fn assume_init(self) -> Box<T, A> { in assume_init()
817 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
818 unsafe { Box::from_raw_in(raw as *mut T, alloc) } in assume_init()
850 pub fn write(mut boxed: Self, value: T) -> Box<T, A> { in write()
858 impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> { impl
891 pub unsafe fn assume_init(self) -> Box<[T], A> { in assume_init()
892 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
893 unsafe { Box::from_raw_in(raw as *mut [T], alloc) } in assume_init()
897 impl<T: ?Sized> Box<T> { impl
947 impl<T: ?Sized, A: Allocator> Box<T, A> { implementation
999 Box(unsafe { Unique::new_unchecked(raw) }, alloc) in from_raw_in()
1096 let (leaked, alloc) = Box::into_unique(b); in into_raw_with_allocator()
1114 (Unique::from(Box::leak(b)), alloc) in into_unique()
1217 unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> { implementation
1225 impl<T: Default> Default for Box<T> { implementation
1229 Box::new(T::default()) in default()
1235 impl<T> Default for Box<[T]> { implementation
1239 Box(ptr, Global) in default()
1245 impl Default for Box<str> { implementation
1253 Box(ptr, Global) in default()
1259 impl<T: Clone, A: Allocator + Clone> Clone for Box<T, A> { implementation
1309 impl Clone for Box<str> { implementation
1312 let buf: Box<[u8]> = self.as_bytes().into(); in clone()
1318 impl<T: ?Sized + PartialEq, A: Allocator> PartialEq for Box<T, A> { implementation
1329 impl<T: ?Sized + PartialOrd, A: Allocator> PartialOrd for Box<T, A> { implementation
1352 impl<T: ?Sized + Ord, A: Allocator> Ord for Box<T, A> { implementation
1359 impl<T: ?Sized + Eq, A: Allocator> Eq for Box<T, A> {} implementation
1362 impl<T: ?Sized + Hash, A: Allocator> Hash for Box<T, A> { implementation
1369 impl<T: ?Sized + Hasher, A: Allocator> Hasher for Box<T, A> { implementation
1422 impl<T> From<T> for Box<T> { implementation
1437 Box::new(t) in from()
1442 impl<T: ?Sized, A: Allocator> From<Box<T, A>> for Pin<Box<T, A>>
1457 fn from(boxed: Box<T, A>) -> Self { in from()
1458 Box::into_pin(boxed) in from()
1469 impl<T: Clone> BoxFromSlice<T> for Box<[T]> { implementation
1477 impl<T: Copy> BoxFromSlice<T> for Box<[T]> { implementation
1491 impl<T: Clone> From<&[T]> for Box<[T]> { implementation
1506 fn from(slice: &[T]) -> Box<[T]> { in from()
1513 impl<T: Clone> From<Cow<'_, [T]>> for Box<[T]> { implementation
1521 fn from(cow: Cow<'_, [T]>) -> Box<[T]> { in from()
1523 Cow::Borrowed(slice) => Box::from(slice), in from()
1524 Cow::Owned(slice) => Box::from(slice), in from()
1531 impl From<&str> for Box<str> { implementation
1544 fn from(s: &str) -> Box<str> { in from()
1545 unsafe { from_boxed_utf8_unchecked(Box::from(s.as_bytes())) } in from()
1551 impl From<Cow<'_, str>> for Box<str> { implementation
1576 fn from(cow: Cow<'_, str>) -> Box<str> { in from()
1578 Cow::Borrowed(s) => Box::from(s), in from()
1579 Cow::Owned(s) => Box::from(s), in from()
1585 impl<A: Allocator> From<Box<str, A>> for Box<[u8], A> { implementation
1603 fn from(s: Box<str, A>) -> Self { in from()
1604 let (raw, alloc) = Box::into_raw_with_allocator(s); in from()
1605 unsafe { Box::from_raw_in(raw as *mut [u8], alloc) } in from()
1611 impl<T, const N: usize> From<[T; N]> for Box<[T]> { implementation
1622 fn from(array: [T; N]) -> Box<[T]> { in from()
1623 Box::new(array)
1633 boxed_slice: Box<[T], A>, in boxed_slice_as_array_unchecked()
1634 ) -> Box<[T; N], A> { in boxed_slice_as_array_unchecked()
1637 let (ptr, alloc) = Box::into_raw_with_allocator(boxed_slice);
1640 unsafe { Box::from_raw_in(ptr as *mut [T; N], alloc) }
1644 impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> { implementation
1645 type Error = Box<[T]>;
1656 fn try_from(boxed_slice: Box<[T]>) -> Result<Self, Self::Error> { in try_from()
1667 impl<T, const N: usize> TryFrom<Vec<T>> for Box<[T; N]> { implementation
1698 impl<A: Allocator> Box<dyn Any, A> { implementation
1718 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1748 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1751 let (raw, alloc): (*mut dyn Any, _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1752 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1757 impl<A: Allocator> Box<dyn Any + Send, A> { impl
1777 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1807 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1810 let (raw, alloc): (*mut (dyn Any + Send), _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1811 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1816 impl<A: Allocator> Box<dyn Any + Send + Sync, A> { impl
1836 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1866 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1870 Box::into_raw_with_allocator(self); in downcast_unchecked()
1871 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1877 impl<T: fmt::Display + ?Sized, A: Allocator> fmt::Display for Box<T, A> { implementation
1884 impl<T: fmt::Debug + ?Sized, A: Allocator> fmt::Debug for Box<T, A> { implementation
1891 impl<T: ?Sized, A: Allocator> fmt::Pointer for Box<T, A> { implementation
1901 impl<T: ?Sized, A: Allocator> Deref for Box<T, A> { implementation
1910 impl<T: ?Sized, A: Allocator> DerefMut for Box<T, A> { implementation
1917 impl<T: ?Sized, A: Allocator> Receiver for Box<T, A> {} implementation
1920 impl<I: Iterator + ?Sized, A: Allocator> Iterator for Box<I, A> { implementation
1941 impl<I: Iterator + ?Sized, A: Allocator> BoxIter for Box<I, A> { implementation
1956 impl<I: Iterator, A: Allocator> BoxIter for Box<I, A> { implementation
1963 impl<I: DoubleEndedIterator + ?Sized, A: Allocator> DoubleEndedIterator for Box<I, A> { implementation
1972 impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A> { implementation
1982 impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A> {} implementation
1985 impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> { implementation
1994 impl<Args: Tuple, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> { implementation
2001 impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> { implementation
2008 impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A> {} implementation
2011 impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global> {} implementation
2015 impl<I> FromIterator<I> for Box<[I]> { implementation
2023 impl<T: Clone, A: Allocator + Clone> Clone for Box<[T], A> { implementation
2025 let alloc = Box::allocator(self).clone(); in clone()
2039 impl<T: ?Sized, A: Allocator> borrow::Borrow<T> for Box<T, A> { implementation
2046 impl<T: ?Sized, A: Allocator> borrow::BorrowMut<T> for Box<T, A> { implementation
2053 impl<T: ?Sized, A: Allocator> AsRef<T> for Box<T, A> { implementation
2060 impl<T: ?Sized, A: Allocator> AsMut<T> for Box<T, A> { implementation
2089 impl<T: ?Sized, A: Allocator> Unpin for Box<T, A> where A: 'static {} implementation
2092 impl<G: ?Sized + Generator<R> + Unpin, R, A: Allocator> Generator<R> for Box<G, A> implementation
2105 impl<G: ?Sized + Generator<R>, R, A: Allocator> Generator<R> for Pin<Box<G, A>>
2118 impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> implementation
2130 impl<S: ?Sized + AsyncIterator + Unpin> AsyncIterator for Box<S> { implementation
2147 pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<dyn Error>> { in downcast()
2150 let raw: *mut dyn Error = Box::into_raw(self); in downcast()
2151 Ok(Box::from_raw(raw as *mut T)) in downcast()
2164 pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<dyn Error + Send>> { in downcast()
2165 let err: Box<dyn Error> = self; in downcast()
2168 mem::transmute::<Box<dyn Error>, Box<dyn Error + Send>>(s) in downcast()
2178 pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<Self>> { in downcast()
2179 let err: Box<dyn Error> = self; in downcast()
2182 mem::transmute::<Box<dyn Error>, Box<dyn Error + Send + Sync>>(s) in downcast()
2189 impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> { implementation
2215 fn from(err: E) -> Box<dyn Error + 'a> { in from()
2216 Box::new(err) in from()
2222 impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync + 'a> { implementation
2254 fn from(err: E) -> Box<dyn Error + Send + Sync + 'a> { in from()
2255 Box::new(err) in from()
2261 impl From<String> for Box<dyn Error + Send + Sync> { implementation
2276 fn from(err: String) -> Box<dyn Error + Send + Sync> { in from()
2299 Box::new(StringError(err)) in from()
2305 impl From<String> for Box<dyn Error> { implementation
2318 fn from(str_err: String) -> Box<dyn Error> { in from()
2319 let err1: Box<dyn Error + Send + Sync> = From::from(str_err); in from()
2320 let err2: Box<dyn Error> = err1; in from()
2327 impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a> { implementation
2344 fn from(err: &str) -> Box<dyn Error + Send + Sync + 'a> { in from()
2351 impl From<&str> for Box<dyn Error> { implementation
2366 fn from(err: &str) -> Box<dyn Error> { in from()
2373 impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a> { implementation
2388 fn from(err: Cow<'b, str>) -> Box<dyn Error + Send + Sync + 'a> { in from()
2395 impl<'a> From<Cow<'a, str>> for Box<dyn Error> { implementation
2409 fn from(err: Cow<'a, str>) -> Box<dyn Error> { in from()
2415 impl<T: core::error::Error> core::error::Error for Box<T> { implementation