Lines Matching defs:boxed
16 //! let boxed: Box<u8> = Box::new(val);
22 //! let boxed: Box<u8> = Box::new(5);
23 //! let val: u8 = *boxed;
41 //! Recursive structures must be boxed, because if the definition of `Cons`
192 /// See the [module-level documentation](../../std/boxed/index.html) for more.
386 let mut boxed = Self::new_uninit_in(alloc);
388 boxed.as_mut_ptr().write(x);
389 boxed.assume_init()
414 let mut boxed = Self::try_new_uninit_in(alloc)?;
416 boxed.as_mut_ptr().write(x);
417 Ok(boxed.assume_init())
591 pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> {
592 let (raw, alloc) = Box::into_raw_with_allocator(boxed);
609 pub fn into_inner(boxed: Self) -> T {
610 *boxed
615 /// Constructs a new boxed slice with uninitialized contents.
642 /// Constructs a new boxed slice with uninitialized contents, with the memory
667 /// Constructs a new boxed slice with uninitialized contents. Returns an error if
702 /// Constructs a new boxed slice with uninitialized contents, with the memory
738 /// Constructs a new boxed slice with uninitialized contents in the provided allocator.
768 /// Constructs a new boxed slice with uninitialized contents in the provided allocator,
862 pub fn write(mut boxed: Self, value: T) -> Box<T, A> {
864 (*boxed).write(value);
865 boxed.assume_init()
1186 /// `*boxed` will be pinned in memory and unable to be moved.
1217 pub const fn into_pin(boxed: Self) -> Pin<Self>
1224 unsafe { Pin::new_unchecked(boxed) }
1299 let mut boxed = Self::new_uninit_in(self.1.clone());
1301 (**self).write_clone_into_raw(boxed.as_mut_ptr());
1302 boxed.assume_init()
1454 /// let boxed = Box::new(5);
1456 /// assert_eq!(Box::from(x), boxed);
1469 /// `*boxed` will be pinned in memory and unable to be moved.
1479 fn from(boxed: Box<T, A>) -> Self {
1480 Box::into_pin(boxed)
1562 /// let boxed: Box<str> = Box::from("hello");
1563 /// println!("{boxed}");
1587 /// let boxed: Box<str> = Box::from(unboxed);
1588 /// println!("{boxed}");
1594 /// let boxed: Box<str> = Box::from(unboxed);
1595 /// println!("{boxed}");
1615 /// let boxed: Box<str> = Box::from("hello");
1616 /// let boxed_str: Box<[u8]> = Box::from(boxed);
1641 /// let boxed: Box<[u8]> = Box::from([4, 2]);
1642 /// println!("{boxed:?}");
1649 /// Casts a boxed slice to a boxed array.