Lines Matching defs:init

30     fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>
39 fn pin_init(init: impl PinInit<T>) -> Result<Pin<Self>, AllocError> {
40 // SAFETY: We delegate to `init` and only change the error type.
41 let init = unsafe {
42 pin_init_from_closure(|slot| match init.__init(slot) {
47 Self::try_pin_init(init)
51 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>
57 fn init(init: impl Init<T>) -> Result<Self, AllocError> {
58 // SAFETY: We delegate to `init` and only change the error type.
59 let init = unsafe {
60 init_from_closure(|slot| match init.__init(slot) {
65 Self::try_init(init)
84 fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>
88 try_new_uninit!(Box).write_pin_init(init)
92 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>
96 try_new_uninit!(Box).write_init(init)
102 fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>
112 // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
114 unsafe { init.__init(slot)? };
120 fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>
130 // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
132 unsafe { init.__init(slot)? };
142 fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> {
144 // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
146 unsafe { init.__init(slot)? };
152 fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> {
154 // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
156 unsafe { init.__init(slot)? };