|
1 | 1 | //! # Pinocchio |
2 | 2 | //! |
3 | | -//! Pinocchio is a zero-dependency library to create Solana programs in Rust. |
4 | | -//! It takes advantage of the way SVM loaders serialize the program input parameters |
5 | | -//! into a byte array that is then passed to the program's entrypoint to define |
6 | | -//! zero-copy types to read the input - these types are defined in an efficient way |
7 | | -//! taking into consideration that they will be used in on-chain programs. |
| 3 | +//! Pinocchio is a "no-external" dependencies library to create Solana programs |
| 4 | +//! in Rust, which means that the only dependencies are from the Solana SDK. This |
| 5 | +//! reduces the chance of dependency conflicts when compiling the program. |
| 6 | +//! |
| 7 | +//! It takes advantage of the way SVM loaders serialize the program input |
| 8 | +//! parameters into a byte array that is then passed to the program's entrypoint |
| 9 | +//! to use zero-copy types to read the input - these types are defined in an efficient |
| 10 | +//! way taking into consideration that they will be used in on-chain programs. |
8 | 11 | //! |
9 | 12 | //! It is intended to be used by on-chain programs only; for off-chain programs, |
10 | | -//! use instead the [`solana-sdk`] crate. |
| 13 | +//! use instead [`solana-sdk`] crates. |
11 | 14 | //! |
12 | 15 | //! [`solana-sdk`]: https://docs.rs/solana-sdk/latest/solana_sdk/ |
13 | 16 | //! |
|
31 | 34 | //! ```ignore |
32 | 35 | //! use pinocchio::{ |
33 | 36 | //! AccountView, |
| 37 | +//! Address, |
34 | 38 | //! entrypoint, |
35 | 39 | //! msg, |
36 | | -//! ProgramResult, |
37 | | -//! Address |
| 40 | +//! ProgramResult |
38 | 41 | //! }; |
39 | 42 | //! |
40 | 43 | //! entrypoint!(process_instruction); |
|
71 | 74 | //! ### [`lazy_program_entrypoint!`] |
72 | 75 | //! |
73 | 76 | //! The [`entrypoint!`] macro looks similar to the "standard" one found in |
74 | | -//! [`solana-program`](https://docs.rs/solana-program-entrypoint/latest/solana_program_entrypoint/macro.entrypoint.html). |
| 77 | +//! [`solana-program-entrypoint`](https://docs.rs/solana-program-entrypoint/latest/solana_program_entrypoint/macro.entrypoint.html). |
75 | 78 | //! It parses the whole input and provides the `program_id`, `accounts` and |
76 | 79 | //! `instruction_data` separately. This consumes compute units before the program |
77 | 80 | //! begins its execution. In some cases, it is beneficial for a program to have |
|
137 | 140 | //! ```ignore |
138 | 141 | //! use pinocchio::{ |
139 | 142 | //! AccountView, |
| 143 | +//! Address, |
140 | 144 | //! default_panic_handler, |
141 | 145 | //! msg, |
142 | 146 | //! no_allocator, |
143 | 147 | //! program_entrypoint, |
144 | | -//! ProgramResult, |
145 | | -//! Address |
| 148 | +//! ProgramResult |
146 | 149 | //! }; |
147 | 150 | //! |
148 | 151 | //! program_entrypoint!(process_instruction); |
|
194 | 197 | //! mod entrypoint { |
195 | 198 | //! use pinocchio::{ |
196 | 199 | //! AccountView, |
| 200 | +//! Address, |
197 | 201 | //! entrypoint, |
198 | 202 | //! msg, |
199 | | -//! ProgramResult, |
200 | | -//! Address |
| 203 | +//! ProgramResult |
201 | 204 | //! }; |
202 | 205 | //! |
203 | 206 | //! entrypoint!(process_instruction); |
|
0 commit comments