File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 68
68
//!
69
69
//! To declare an init macro/function you just return an `impl`[`PinInit<T, E>`]:
70
70
//! ```rust
71
- //! # use kernel::prelude::*;
71
+ //! # use kernel::{sync::Mutex, prelude::*, new_mutex, init::PinInit} ;
72
72
//! #[pin_project]
73
73
//! struct DriverData {
74
+ //! #[pin]
74
75
//! status: Mutex<i32>,
75
76
//! buffer: Box<[u8; 1_000_000]>,
76
77
//! }
77
78
//!
78
79
//! impl DriverData {
79
- //! fn new() -> impl PinInit<Self Error> {
80
+ //! fn new() -> impl PinInit<Self, Error> {
80
81
//! pin_init!(Self {
81
82
//! status: new_mutex!(0, "DriverData::status"),
82
- //! buffer: Box::init(kernel::init::zeroed()),
83
+ //! buffer: Box::init(kernel::init::zeroed())? ,
83
84
//! })
84
85
//! }
85
86
//! }
@@ -192,15 +193,17 @@ macro_rules! stack_init {
192
193
///
193
194
/// ```rust
194
195
/// # #![allow(clippy::blacklisted_name, clippy::new_ret_no_self)]
195
- /// # use kernel::{init, pin_init, pin_data , init::*};
196
+ /// # use kernel::{init, pin_init, prelude::* , init::*};
196
197
/// # use core::pin::Pin;
197
- /// # pin_data! { struct Foo {
198
+ /// # #[pin_project]
199
+ /// # struct Foo {
198
200
/// # a: usize,
199
201
/// # b: Bar,
200
- /// # }}
201
- /// # pin_data! { struct Bar {
202
+ /// # }
203
+ /// # #[pin_project]
204
+ /// # struct Bar {
202
205
/// # x: u32,
203
- /// # }}
206
+ /// # }
204
207
///
205
208
/// impl Foo {
206
209
/// fn new() -> impl PinInit<Self> {
You can’t perform that action at this time.
0 commit comments