Lines Matching refs:T
65 pub struct Box<T: ?Sized, A: Allocator>(NonNull<T>, PhantomData<A>);
77 pub type KBox<T> = Box<T, super::allocator::Kmalloc>;
89 pub type VBox<T> = Box<T, super::allocator::Vmalloc>;
101 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>;
105 unsafe impl<T, A: Allocator> ZeroableOption for Box<T, A> {}
108 unsafe impl<T, A> Send for Box<T, A>
110 T: Send + ?Sized,
116 unsafe impl<T, A> Sync for Box<T, A>
118 T: Sync + ?Sized,
123 impl<T, A> Box<T, A>
125 T: ?Sized,
138 pub const unsafe fn from_raw(raw: *mut T) -> Self { in from_raw()
162 pub fn into_raw(b: Self) -> *mut T { in into_raw() argument
170 pub fn leak<'a>(b: Self) -> &'a mut T { in leak() argument
177 impl<T, A> Box<MaybeUninit<T>, A>
189 pub unsafe fn assume_init(self) -> Box<T, A> { in assume_init() argument
199 pub fn write(mut self, value: T) -> Box<T, A> { in write() argument
207 impl<T, A> Box<T, A>
215 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
234 pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> { in new_uninit() argument
235 let layout = Layout::new::<MaybeUninit<T>>(); in new_uninit()
246 pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> in pin() argument
260 fn forget_contents(this: Self) -> Box<MaybeUninit<T>, A> { in forget_contents() argument
280 pub fn drop_contents(this: Self) -> Box<MaybeUninit<T>, A> { in drop_contents() argument
291 pub fn into_inner(b: Self) -> T { in into_inner() argument
299 impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>
301 T: ?Sized,
308 fn from(b: Box<T, A>) -> Self { in from() argument
315 impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A>
319 type Initialized = Box<T, A>;
321 fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> { in write_init() argument
330 fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> { in write_pin_init() argument
340 impl<T, A> InPlaceInit<T> for Box<T, A>
347 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E> in try_pin_init() argument
355 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in try_init() argument
363 impl<T: 'static, A> ForeignOwnable for Box<T, A>
367 type Borrowed<'a> = &'a T;
368 type BorrowedMut<'a> = &'a mut T;
380 unsafe fn borrow<'a>(ptr: *mut crate::ffi::c_void) -> &'a T { in borrow() argument
386 unsafe fn borrow_mut<'a>(ptr: *mut crate::ffi::c_void) -> &'a mut T { in borrow_mut() argument
394 impl<T: 'static, A> ForeignOwnable for Pin<Box<T, A>>
398 type Borrowed<'a> = Pin<&'a T>;
399 type BorrowedMut<'a> = Pin<&'a mut T>;
412 unsafe fn borrow<'a>(ptr: *mut crate::ffi::c_void) -> Pin<&'a T> { in borrow() argument
423 unsafe fn borrow_mut<'a>(ptr: *mut crate::ffi::c_void) -> Pin<&'a mut T> { in borrow_mut() argument
436 impl<T, A> Deref for Box<T, A>
438 T: ?Sized,
441 type Target = T;
443 fn deref(&self) -> &T { in deref() argument
450 impl<T, A> DerefMut for Box<T, A>
452 T: ?Sized,
455 fn deref_mut(&mut self) -> &mut T { in deref_mut() argument
462 impl<T, A> fmt::Display for Box<T, A>
464 T: ?Sized + fmt::Display,
468 <T as fmt::Display>::fmt(&**self, f) in fmt()
472 impl<T, A> fmt::Debug for Box<T, A>
474 T: ?Sized + fmt::Debug,
478 <T as fmt::Debug>::fmt(&**self, f) in fmt()
482 impl<T, A> Drop for Box<T, A>
484 T: ?Sized,
488 let layout = Layout::for_value::<T>(self); in drop()
491 unsafe { core::ptr::drop_in_place::<T>(self.deref_mut()) }; in drop()