Lines Matching defs:PinInit
66 //! If you want to use [`PinInit`], then you will have to annotate your `struct` with
93 //! `foo` now is of the type [`impl PinInit<Foo>`]. We can now use any smart pointer that we like
133 //! To declare an init macro/function you just return an [`impl PinInit<T, E>`]:
148 //! fn new() -> impl PinInit<Self, Error> {
161 //! [`impl PinInit<T, E>`] directly from a closure. Of course you have to ensure that the closure
173 //! use pin_init::{pin_data, pinned_drop, PinInit, PinnedDrop, pin_init_from_closure};
206 //! pub fn new(flags: u32) -> impl PinInit<Self, i32> {
262 //! [`impl PinInit<Foo>`]: crate::PinInit
263 //! [`impl PinInit<T, E>`]: crate::PinInit
493 /// [`PinInit`]/[`Init`] with the error type [`Infallible`]. If you want to use a different error
571 /// [`PinInit`]/[`Init`]. This macro assigns a result to the given variable, adding a `?` after the
608 /// # fn demo() -> impl PinInit<Foo> {
651 /// fn new() -> impl PinInit<Self> {
678 /// # fn new() -> impl PinInit<Self> {
705 /// # fn new() -> impl PinInit<Self> {
724 /// fn new(other: u32) -> impl PinInit<Self> {
734 /// Here we see that when using `pin_init!` with `PinInit`, one needs to write `<-` instead of `:`.
810 /// use pin_init::{pin_data, try_pin_init, PinInit, InPlaceInit, init_zeroed};
820 /// fn new() -> impl PinInit<Self, Error> {
1038 /// The [`PinInit::__pinned_init`] function:
1057 pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
1094 /// An initializer returned by [`PinInit::pin_chain`].
1101 unsafe impl<T: ?Sized, E, I, F> PinInit<T, E> for ChainPinInit<I, F, T, E>
1103 I: PinInit<T, E>,
1122 /// [`PinInit<T, E>`] is a super trait, you can use every function that takes it as well.
1139 /// The `__pinned_init` function from the supertrait [`PinInit`] needs to execute the exact same
1142 /// Contrary to its supertype [`PinInit<T, E>`] the caller is allowed to
1156 pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
1224 unsafe impl<T: ?Sized, E, I, F> PinInit<T, E> for ChainInit<I, F, T, E>
1235 /// Creates a new [`PinInit<T, E>`] from the given closure.
1250 ) -> impl PinInit<T, E> {
1280 pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> {
1369 ) -> impl PinInit<[T; N], E>
1371 I: PinInit<T, E>,
1406 unsafe impl<T> PinInit<T> for T {
1428 unsafe impl<T, E> PinInit<T, E> for Result<T, E> {
1449 fn write_pin_init<E>(self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E>;
1710 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E>;
1714 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> {
1721 fn pin_init<E>(value_init: impl PinInit<T, E>) -> impl PinInit<Self, E> {
1729 fn pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> {