1 // SPDX-License-Identifier: GPL-2.0
3 //! Rust minimal sample.
5 use kernel::prelude::*;
10 author: "Rust for Linux Contributors",
11 description: "Rust minimal sample",
19 impl kernel::Module for RustMinimal {
20 fn init(_module: &'static ThisModule) -> Result<Self> {
21 pr_info!("Rust minimal sample (init)\n");
22 pr_info!("Am I built-in? {}\n", !cfg!(MODULE));
24 let mut numbers = Vec::new();
25 numbers.try_push(72)?;
26 numbers.try_push(108)?;
27 numbers.try_push(200)?;
29 Ok(RustMinimal { numbers })
33 impl Drop for RustMinimal {
35 pr_info!("My numbers are {:?}\n", self.numbers);
36 pr_info!("Rust minimal sample (exit)\n");