Lines Matching defs:init
3 //! Extensions to the [`pin-init`] crate.
8 //! The [`pin-init`] crate is the way such structs are initialized on the Rust side. Please refer
15 //! [`pin-init`]: https://rust.docs.kernel.org/pin_init/
146 fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self::PinnedSelf, E>
154 fn pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> error::Result<Self::PinnedSelf>
158 // SAFETY: We delegate to `init` and only change the error type.
159 let init = unsafe {
160 pin_init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e)))
162 Self::try_pin_init(init, flags)
166 fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E>
171 fn init<E>(init: impl Init<T, E>, flags: Flags) -> error::Result<Self>
175 // SAFETY: We delegate to `init` and only change the error type.
176 let init = unsafe {
177 init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e)))
179 Self::try_init(init, flags)
186 /// [`init!`].
209 /// big: KBox::init(init_zeroed(), GFP_KERNEL)?,
217 /// [`init!`]: pin_init::init
223 ::pin_init::init!(
261 /// big: KBox::init(init_zeroed(), GFP_KERNEL)?,