Lines Matching refs:Box

184 pub struct Box<  struct
189 impl<T> Box<T> { implementation
229 pub fn new_uninit() -> Box<mem::MaybeUninit<T>> { in new_uninit()
255 pub fn new_zeroed() -> Box<mem::MaybeUninit<T>> { in new_zeroed()
265 pub fn pin(x: T) -> Pin<Box<T>> { in pin()
311 pub fn try_new_uninit() -> Result<Box<mem::MaybeUninit<T>>, AllocError> { in try_new_uninit()
312 Box::try_new_uninit_in(Global) in try_new_uninit()
337 pub fn try_new_zeroed() -> Result<Box<mem::MaybeUninit<T>>, AllocError> { in try_new_zeroed()
338 Box::try_new_zeroed_in(Global) in try_new_zeroed()
342 impl<T, A: Allocator> Box<T, A> { impls
427 pub const fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_uninit_in()
434 match Box::try_new_uninit_in(alloc) { in new_uninit_in()
465 pub const fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_uninit_in()
471 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_uninit_in()
499 pub const fn new_zeroed_in(alloc: A) -> Box<mem::MaybeUninit<T>, A> in new_zeroed_in()
506 match Box::try_new_zeroed_in(alloc) { in new_zeroed_in()
537 pub const fn try_new_zeroed_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocError> in try_new_zeroed_in()
543 unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } in try_new_zeroed_in()
565 pub const fn into_boxed_slice(boxed: Self) -> Box<[T], A> { in into_boxed_slice()
566 let (raw, alloc) = Box::into_raw_with_allocator(boxed); in into_boxed_slice()
567 unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) } in into_boxed_slice()
592 impl<T> Box<[T]> { implementation
616 pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_uninit_slice()
641 pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_zeroed_slice()
667 pub fn try_new_uninit_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_uninit_slice()
699 pub fn try_new_zeroed_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_zeroed_slice()
711 impl<T, A: Allocator> Box<[T], A> { implementation
738 pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_uninit_slice_in()
766 pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> { in new_zeroed_slice_in()
771 impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> { implementation
803 pub const unsafe fn assume_init(self) -> Box<T, A> { in assume_init()
804 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
805 unsafe { Box::from_raw_in(raw as *mut T, alloc) } in assume_init()
838 pub const fn write(mut boxed: Self, value: T) -> Box<T, A> { in write()
846 impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> { impls
879 pub unsafe fn assume_init(self) -> Box<[T], A> { in assume_init()
880 let (raw, alloc) = Box::into_raw_with_allocator(self); in assume_init()
881 unsafe { Box::from_raw_in(raw as *mut [T], alloc) } in assume_init()
885 impl<T: ?Sized> Box<T> { impls
934 impl<T: ?Sized, A: Allocator> Box<T, A> { implementation
986 Box(unsafe { Unique::new_unchecked(raw) }, alloc) in from_raw_in()
1084 let (leaked, alloc) = Box::into_unique(b); in into_raw_with_allocator()
1103 (Unique::from(Box::leak(b)), alloc) in into_unique()
1182 unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> { implementation
1190 impl<T: Default> Default for Box<T> { implementation
1200 impl<T> const Default for Box<[T]> { implementation
1203 Box(ptr, Global) in default()
1210 impl const Default for Box<str> { implementation
1217 Box(ptr, Global) in default()
1223 impl<T: Clone, A: Allocator + Clone> Clone for Box<T, A> { implementation
1273 impl Clone for Box<str> { implementation
1276 let buf: Box<[u8]> = self.as_bytes().into(); in clone()
1282 impl<T: ?Sized + PartialEq, A: Allocator> PartialEq for Box<T, A> { implementation
1293 impl<T: ?Sized + PartialOrd, A: Allocator> PartialOrd for Box<T, A> { implementation
1316 impl<T: ?Sized + Ord, A: Allocator> Ord for Box<T, A> { implementation
1323 impl<T: ?Sized + Eq, A: Allocator> Eq for Box<T, A> {} implementation
1326 impl<T: ?Sized + Hash, A: Allocator> Hash for Box<T, A> { implementation
1333 impl<T: ?Sized + Hasher, A: Allocator> Hasher for Box<T, A> { implementation
1386 impl<T> From<T> for Box<T> { implementation
1401 Box::new(t) in from()
1407 impl<T: ?Sized, A: Allocator> const From<Box<T, A>> for Pin<Box<T, A>>
1414 fn from(boxed: Box<T, A>) -> Self { in from()
1415 Box::into_pin(boxed) in from()
1421 impl<T: Copy> From<&[T]> for Box<[T]> { implementation
1435 fn from(slice: &[T]) -> Box<[T]> { in from()
1447 impl<T: Copy> From<Cow<'_, [T]>> for Box<[T]> { implementation
1455 fn from(cow: Cow<'_, [T]>) -> Box<[T]> { in from()
1457 Cow::Borrowed(slice) => Box::from(slice), in from()
1458 Cow::Owned(slice) => Box::from(slice), in from()
1465 impl From<&str> for Box<str> { implementation
1478 fn from(s: &str) -> Box<str> { in from()
1479 unsafe { from_boxed_utf8_unchecked(Box::from(s.as_bytes())) } in from()
1485 impl From<Cow<'_, str>> for Box<str> { implementation
1510 fn from(cow: Cow<'_, str>) -> Box<str> { in from()
1512 Cow::Borrowed(s) => Box::from(s), in from()
1513 Cow::Owned(s) => Box::from(s), in from()
1519 impl<A: Allocator> From<Box<str, A>> for Box<[u8], A> { implementation
1537 fn from(s: Box<str, A>) -> Self { in from()
1538 let (raw, alloc) = Box::into_raw_with_allocator(s); in from()
1539 unsafe { Box::from_raw_in(raw as *mut [u8], alloc) } in from()
1545 impl<T, const N: usize> From<[T; N]> for Box<[T]> { implementation
1556 fn from(array: [T; N]) -> Box<[T]> { in from()
1562 impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> { implementation
1563 type Error = Box<[T]>;
1574 fn try_from(boxed_slice: Box<[T]>) -> Result<Self, Self::Error> { in try_from()
1576 Ok(unsafe { Box::from_raw(Box::into_raw(boxed_slice) as *mut [T; N]) }) in try_from()
1583 impl<A: Allocator> Box<dyn Any, A> { implementation
1603 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1633 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1636 let (raw, alloc): (*mut dyn Any, _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1637 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1642 impl<A: Allocator> Box<dyn Any + Send, A> { implementation
1662 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1692 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1695 let (raw, alloc): (*mut (dyn Any + Send), _) = Box::into_raw_with_allocator(self); in downcast_unchecked()
1696 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1701 impl<A: Allocator> Box<dyn Any + Send + Sync, A> { impls
1721 pub fn downcast<T: Any>(self) -> Result<Box<T, A>, Self> { in downcast()
1751 pub unsafe fn downcast_unchecked<T: Any>(self) -> Box<T, A> { in downcast_unchecked()
1755 Box::into_raw_with_allocator(self); in downcast_unchecked()
1756 Box::from_raw_in(raw as *mut T, alloc) in downcast_unchecked()
1762 impl<T: fmt::Display + ?Sized, A: Allocator> fmt::Display for Box<T, A> { implementation
1769 impl<T: fmt::Debug + ?Sized, A: Allocator> fmt::Debug for Box<T, A> { implementation
1776 impl<T: ?Sized, A: Allocator> fmt::Pointer for Box<T, A> { implementation
1787 impl<T: ?Sized, A: Allocator> const Deref for Box<T, A> { implementation
1797 impl<T: ?Sized, A: Allocator> const DerefMut for Box<T, A> { implementation
1804 impl<T: ?Sized, A: Allocator> Receiver for Box<T, A> {} implementation
1807 impl<I: Iterator + ?Sized, A: Allocator> Iterator for Box<I, A> { implementation
1828 impl<I: Iterator + ?Sized, A: Allocator> BoxIter for Box<I, A> { implementation
1843 impl<I: Iterator, A: Allocator> BoxIter for Box<I, A> { implementation
1850 impl<I: DoubleEndedIterator + ?Sized, A: Allocator> DoubleEndedIterator for Box<I, A> { implementation
1859 impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A> { implementation
1869 impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A> {} implementation
1872 impl<Args, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> { implementation
1881 impl<Args, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> { implementation
1888 impl<Args, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> { implementation
1895 impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Box<U, A>> for Box<T, A> {} implementation
1898 impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T, Global> {} implementation
1902 impl<I> FromIterator<I> for Box<[I]> { implementation
1910 impl<T: Clone, A: Allocator + Clone> Clone for Box<[T], A> { implementation
1912 let alloc = Box::allocator(self).clone(); in clone()
1926 impl<T: ?Sized, A: Allocator> borrow::Borrow<T> for Box<T, A> { implementation
1933 impl<T: ?Sized, A: Allocator> borrow::BorrowMut<T> for Box<T, A> { implementation
1940 impl<T: ?Sized, A: Allocator> AsRef<T> for Box<T, A> { implementation
1947 impl<T: ?Sized, A: Allocator> AsMut<T> for Box<T, A> { implementation
1977 impl<T: ?Sized, A: Allocator> const Unpin for Box<T, A> where A: 'static {} implementation
1980 impl<G: ?Sized + Generator<R> + Unpin, R, A: Allocator> Generator<R> for Box<G, A> implementation
1993 impl<G: ?Sized + Generator<R>, R, A: Allocator> Generator<R> for Pin<Box<G, A>>
2006 impl<F: ?Sized + Future + Unpin, A: Allocator> Future for Box<F, A> implementation
2018 impl<S: ?Sized + AsyncIterator + Unpin> AsyncIterator for Box<S> { implementation