Lines Matching refs:T

80 pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?Sized, A: Allocator>(
81 NonNull<T>,
88 impl<T, U, A> core::ops::CoerceUnsized<Box<U, A>> for Box<T, A>
90 T: ?Sized + core::marker::Unsize<U>,
99 impl<T, U, A> core::ops::DispatchFromDyn<Box<U, A>> for Box<T, A>
101 T: ?Sized + core::marker::Unsize<U>,
117 pub type KBox<T> = Box<T, super::allocator::Kmalloc>;
129 pub type VBox<T> = Box<T, super::allocator::Vmalloc>;
141 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>;
145 unsafe impl<T, A: Allocator> ZeroableOption for Box<T, A> {}
148 unsafe impl<T, A> Send for Box<T, A>
150 T: Send + ?Sized,
156 unsafe impl<T, A> Sync for Box<T, A>
158 T: Sync + ?Sized,
163 impl<T, A> Box<T, A>
165 T: ?Sized,
178 pub const unsafe fn from_raw(raw: *mut T) -> Self { in from_raw()
202 pub fn into_raw(b: Self) -> *mut T { in into_raw() argument
210 pub fn leak<'a>(b: Self) -> &'a mut T { in leak() argument
217 impl<T, A> Box<MaybeUninit<T>, A>
229 pub unsafe fn assume_init(self) -> Box<T, A> { in assume_init() argument
239 pub fn write(mut self, value: T) -> Box<T, A> { in write() argument
247 impl<T, A> Box<T, A>
255 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
274 pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> { in new_uninit() argument
275 let layout = Layout::new::<MaybeUninit<T>>(); in new_uninit()
286 pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> in pin() argument
300 fn forget_contents(this: Self) -> Box<MaybeUninit<T>, A> { in forget_contents() argument
320 pub fn drop_contents(this: Self) -> Box<MaybeUninit<T>, A> { in drop_contents() argument
331 pub fn into_inner(b: Self) -> T { in into_inner() argument
339 impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>
341 T: ?Sized,
348 fn from(b: Box<T, A>) -> Self { in from() argument
355 impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A>
359 type Initialized = Box<T, A>;
361 fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> { in write_init() argument
370 fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> { in write_pin_init() argument
380 impl<T, A> InPlaceInit<T> for Box<T, A>
387 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> in try_pin_init() argument
395 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() argument
405 unsafe impl<T: 'static, A> ForeignOwnable for Box<T, A>
409 const FOREIGN_ALIGN: usize = core::mem::align_of::<T>();
410 type Borrowed<'a> = &'a T;
411 type BorrowedMut<'a> = &'a mut T;
423 unsafe fn borrow<'a>(ptr: *mut c_void) -> &'a T { in borrow() argument
429 unsafe fn borrow_mut<'a>(ptr: *mut c_void) -> &'a mut T { in borrow_mut() argument
439 unsafe impl<T: 'static, A> ForeignOwnable for Pin<Box<T, A>>
443 const FOREIGN_ALIGN: usize = core::mem::align_of::<T>();
444 type Borrowed<'a> = Pin<&'a T>;
445 type BorrowedMut<'a> = Pin<&'a mut T>;
458 unsafe fn borrow<'a>(ptr: *mut c_void) -> Pin<&'a T> { in borrow() argument
469 unsafe fn borrow_mut<'a>(ptr: *mut c_void) -> Pin<&'a mut T> { in borrow_mut() argument
482 impl<T, A> Deref for Box<T, A>
484 T: ?Sized,
487 type Target = T;
489 fn deref(&self) -> &T { in deref() argument
496 impl<T, A> DerefMut for Box<T, A>
498 T: ?Sized,
501 fn deref_mut(&mut self) -> &mut T { in deref_mut() argument
526 impl<T, A> Borrow<T> for Box<T, A>
528 T: ?Sized,
531 fn borrow(&self) -> &T { in borrow() argument
554 impl<T, A> BorrowMut<T> for Box<T, A>
556 T: ?Sized,
559 fn borrow_mut(&mut self) -> &mut T { in borrow_mut() argument
564 impl<T, A> fmt::Display for Box<T, A>
566 T: ?Sized + fmt::Display,
570 <T as fmt::Display>::fmt(&**self, f) in fmt()
574 impl<T, A> fmt::Debug for Box<T, A>
576 T: ?Sized + fmt::Debug,
580 <T as fmt::Debug>::fmt(&**self, f) in fmt()
584 impl<T, A> Drop for Box<T, A>
586 T: ?Sized,
590 let layout = Layout::for_value::<T>(self); in drop()
593 unsafe { core::ptr::drop_in_place::<T>(self.deref_mut()) }; in drop()