Lines Matching refs:T
81 pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?Sized, A: Allocator>(
82 NonNull<T>,
89 impl<T, U, A> core::ops::CoerceUnsized<Box<U, A>> for Box<T, A>
91 T: ?Sized + core::marker::Unsize<U>,
100 impl<T, U, A> core::ops::DispatchFromDyn<Box<U, A>> for Box<T, A>
102 T: ?Sized + core::marker::Unsize<U>,
118 pub type KBox<T> = Box<T, super::allocator::Kmalloc>;
130 pub type VBox<T> = Box<T, super::allocator::Vmalloc>;
142 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>;
146 unsafe impl<T, A: Allocator> ZeroableOption for Box<T, A> {}
149 unsafe impl<T, A> Send for Box<T, A>
151 T: Send + ?Sized,
157 unsafe impl<T, A> Sync for Box<T, A>
159 T: Sync + ?Sized,
164 impl<T, A> Box<T, A>
166 T: ?Sized,
179 pub const unsafe fn from_raw(raw: *mut T) -> Self { in from_raw()
203 pub fn into_raw(b: Self) -> *mut T { in into_raw() argument
211 pub fn leak<'a>(b: Self) -> &'a mut T { in leak() argument
218 impl<T, A> Box<MaybeUninit<T>, A>
230 pub unsafe fn assume_init(self) -> Box<T, A> { in assume_init() argument
240 pub fn write(mut self, value: T) -> Box<T, A> { in write() argument
248 impl<T, A> Box<T, A>
256 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
275 pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> { in new_uninit() argument
276 let layout = Layout::new::<MaybeUninit<T>>(); in new_uninit()
287 pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> in pin() argument
340 ) -> Result<Pin<Box<[T], A>>, E> in pin_slice() argument
343 Item: PinInit<T, E>, in pin_slice() argument
346 let mut buffer = super::Vec::<T, A>::with_capacity(len, flags)?; in pin_slice()
378 fn forget_contents(this: Self) -> Box<MaybeUninit<T>, A> { in forget_contents() argument
398 pub fn drop_contents(this: Self) -> Box<MaybeUninit<T>, A> { in drop_contents() argument
409 pub fn into_inner(b: Self) -> T { in into_inner() argument
417 impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>
419 T: ?Sized,
426 fn from(b: Box<T, A>) -> Self { in from() argument
433 impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A>
437 type Initialized = Box<T, A>;
439 fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> { in write_init() argument
448 fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> { in write_pin_init() argument
458 impl<T, A> InPlaceInit<T> for Box<T, A>
465 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> in try_pin_init() argument
473 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() argument
483 unsafe impl<T: 'static, A> ForeignOwnable for Box<T, A>
487 const FOREIGN_ALIGN: usize = if core::mem::align_of::<T>() < A::MIN_ALIGN {
490 core::mem::align_of::<T>()
493 type Borrowed<'a> = &'a T;
494 type BorrowedMut<'a> = &'a mut T;
506 unsafe fn borrow<'a>(ptr: *mut c_void) -> &'a T { in borrow() argument
512 unsafe fn borrow_mut<'a>(ptr: *mut c_void) -> &'a mut T { in borrow_mut() argument
522 unsafe impl<T: 'static, A> ForeignOwnable for Pin<Box<T, A>>
526 const FOREIGN_ALIGN: usize = <Box<T, A> as ForeignOwnable>::FOREIGN_ALIGN;
527 type Borrowed<'a> = Pin<&'a T>;
528 type BorrowedMut<'a> = Pin<&'a mut T>;
541 unsafe fn borrow<'a>(ptr: *mut c_void) -> Pin<&'a T> { in borrow() argument
552 unsafe fn borrow_mut<'a>(ptr: *mut c_void) -> Pin<&'a mut T> { in borrow_mut() argument
565 impl<T, A> Deref for Box<T, A>
567 T: ?Sized,
570 type Target = T;
572 fn deref(&self) -> &T { in deref() argument
579 impl<T, A> DerefMut for Box<T, A>
581 T: ?Sized,
584 fn deref_mut(&mut self) -> &mut T { in deref_mut() argument
609 impl<T, A> Borrow<T> for Box<T, A>
611 T: ?Sized,
614 fn borrow(&self) -> &T { in borrow() argument
637 impl<T, A> BorrowMut<T> for Box<T, A>
639 T: ?Sized,
642 fn borrow_mut(&mut self) -> &mut T { in borrow_mut() argument
647 impl<T, A> fmt::Display for Box<T, A>
649 T: ?Sized + fmt::Display,
653 <T as fmt::Display>::fmt(&**self, f) in fmt()
657 impl<T, A> fmt::Debug for Box<T, A>
659 T: ?Sized + fmt::Debug,
663 <T as fmt::Debug>::fmt(&**self, f) in fmt()
667 impl<T, A> Drop for Box<T, A>
669 T: ?Sized,
673 let layout = Layout::for_value::<T>(self); in drop()
676 unsafe { core::ptr::drop_in_place::<T>(self.deref_mut()) }; in drop()
704 impl<T> AsPageIter for VBox<T> {
708 T: 'a;
712 let size = core::mem::size_of::<T>(); in page_iter()