Lines Matching full:use
10 //! This library's main use-case is in [Rust-for-Linux]. Although this version can be used
59 //! Throughout the examples we will often make use of the `CMutex` type which can be found in
66 //! If you want to use [`PinInit`], then you will have to annotate your `struct` with
75 //! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
76 //! # use core::pin::Pin;
77 //! use pin_init::{pin_data, pin_init, InPlaceInit};
93 //! `foo` now is of the type [`impl PinInit<Foo>`]. We can now use any smart pointer that we like
99 //! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
100 //! # use core::{alloc::AllocError, pin::Pin};
101 //! # use pin_init::*;
121 //! Many types that use this library supply a function/macro that returns an initializer, because
126 //! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
127 //! # use pin_init::*;
128 //! # use std::sync::Arc;
129 //! # use core::pin::Pin;
137 //! # use pin_init::*;
138 //! # #[path = "../examples/error.rs"] mod error; use error::Error;
139 //! # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
173 //! use pin_init::{pin_data, pinned_drop, PinInit, PinnedDrop, pin_init_from_closure};
174 //! use core::{
244 //! For more information on how to use [`pin_init_from_closure()`], take a look at the uses inside
283 use core::{
301 pub use alloc::InPlaceInit;
310 /// This macro enables the use of the [`pin_init!`] macro. When pin-initializing a `struct`,
321 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
322 /// use pin_init::pin_data;
338 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
340 /// use core::pin::Pin;
341 /// use pin_init::{pin_data, pinned_drop, PinnedDrop};
362 pub use ::pin_init_internal::pin_data;
372 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
374 /// use core::pin::Pin;
375 /// use pin_init::{pin_data, pinned_drop, PinnedDrop};
396 pub use ::pin_init_internal::pinned_drop;
406 /// use pin_init::Zeroable;
417 /// use pin_init::Zeroable;
425 pub use ::pin_init_internal::Zeroable;
436 /// use pin_init::MaybeZeroable;
456 pub use ::pin_init_internal::MaybeZeroable;
465 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
466 /// # use pin_init::*;
467 /// # use core::pin::Pin;
493 /// [`PinInit`]/[`Init`] with the error type [`Infallible`]. If you want to use a different error
494 /// type, then use [`stack_try_pin_init!`].
517 /// # #[path = "../examples/error.rs"] mod error; use error::Error;
518 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
519 /// # use pin_init::*;
544 /// # #[path = "../examples/error.rs"] mod error; use error::Error;
545 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
546 /// # use pin_init::*;
589 /// This macro defaults the error to [`Infallible`]. If you need a different error, then use
595 /// # use pin_init::*;
596 /// # use core::pin::Pin;
639 /// # use pin_init::*;
640 /// # use core::pin::Pin;
666 /// # use pin_init::*;
667 /// # use core::pin::Pin;
693 /// # use pin_init::*;
694 /// # use core::pin::Pin;
742 /// - Fields that you want to initialize in-place have to use `<-` instead of `:`.
752 /// # use pin_init::*;
753 /// # use core::{ptr::addr_of_mut, marker::PhantomPinned};
792 /// If the initialization can complete without error (or [`Infallible`]), then use [`pin_init!`].
794 /// You can use the `?` operator or use `return Err(err)` inside the initializer to stop
801 /// after the `struct` initializer to specify the error type you want to use.
807 /// # #[path = "../examples/error.rs"] mod error; use error::Error;
808 /// use pin_init::{pin_data, try_pin_init, PinInit, InPlaceInit, init_zeroed};
850 /// This macro defaults the error to [`Infallible`]. If you need a different error, then use
860 /// pin-initialize, use [`pin_init!`].
866 /// # #[path = "../examples/error.rs"] mod error; use error::Error;
867 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
868 /// # use pin_init::InPlaceInit;
869 /// use pin_init::{init, Init, init_zeroed};
899 /// If the initialization can complete without error (or [`Infallible`]), then use
914 /// # use core::alloc::AllocError;
915 /// # use pin_init::InPlaceInit;
916 /// use pin_init::{try_init, Init, init_zeroed};
960 /// use pin_init::{pin_data, assert_pinned};
973 /// use pin_init::{pin_data, assert_pinned};
983 /// Some uses of the macro may trigger the `can't use generic parameters from outer item` error. To
987 /// # use core::pin::Pin;
988 /// use pin_init::{pin_data, assert_pinned};
1026 /// To use this initializer, you will need a suitable memory location that can hold a `T`. This can
1034 /// cases where a manual implementation is necessary. Use [`pin_init_from_closure`] where possible.
1075 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1076 /// # use pin_init::*;
1118 /// To use this initializer, you will need a suitable memory location that can hold a `T`. This can
1120 /// [`PinInit<T, E>`] is a super trait, you can use every function that takes it as well.
1127 /// cases where a manual implementation is necessary. Use [`init_from_closure`] where possible.
1173 /// use pin_init::{init, init_zeroed, Init};
1317 /// # use pin_init::*;
1318 /// use pin_init::init_array_from_fn;
1356 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1357 /// # use pin_init::*;
1358 /// # use core::pin::Pin;
1359 /// use pin_init::pin_init_array_from_fn;
1360 /// use std::sync::Arc;
1439 /// Use the given initializer to write a value into `self`.
1444 /// Use the given pin-initializer to write a value into `self`.
1452 /// Use [`pinned_drop`] to implement this trait safely:
1456 /// # #[path = "../examples/mutex.rs"] mod mutex; use mutex::*;
1457 /// # use pin_init::*;
1458 /// use core::pin::Pin;
1518 /// use pin_init::{Zeroable, zeroed};
1582 /// use pin_init::{Zeroable, zeroed};
1639 // We cannot use `T: ?Sized`, since the VTABLE pointer part of fat pointers is not allowed to be
1642 // When `Pointee` gets stabilized, we could use
1689 /// # use core::cell::UnsafeCell;
1690 /// # use pin_init::{pin_data, pin_init, Wrapper};