Warning: Undefined array key "rss_show_deleted" in /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/feed.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/feed.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/feed.php on line 55

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/feed.php on line 56

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/inc/httputils.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /var/www/w12/dw/inc/Feed/FeedCreatorOptions.php:86) in /var/www/w12/dw/inc/httputils.php on line 33
wi12.unix7.org - rust https://w12.unix7.org/ Wed, 05 Aug 2026 06:20:14 +0000 FeedCreator 1.8 https://w12.unix7.org/_media/wiki/dokuwiki.svg wi12.unix7.org https://w12.unix7.org/ Out https://w12.unix7.org/rust/accu-sample #![allow(dead_code)] #![allow(unused_variables)] #![allow(unused_imports)] struct Goods { name: String, cost: i64 } impl Goods { fn new(name: String, cost: i64) -> Goods { return Goods { name: name, cost: cost } } } struct Accu { list: Vec<Goods>, total: i64 } impl Accu { fn add(&mut self, t: Goods) { println!("add : {}, {}", t.name, t.cost); self.total += t.cost; self.list.push(t); } } fn main() { let w = Goods::new(String… anonymous@undisclosed.example.com (Anonymous) Sat, 27 Nov 2021 13:26:11 +0000 Rust basic sample https://w12.unix7.org/rust/basic Rust basic sample Basic samples of * objects * closures * namespaces * directives * threads #![allow(unused_variables)] #![allow(unused_imports)] use std::thread; // object pub struct Package { size: i64 } // object implementatation impl Package { pub fn new(size: i64) -> Package { return Package { size: size }; } pub fn getsize(&self) -> i64 { return self.size; } pub fn hello(&self) -> String { return String::from("object hello")… anonymous@undisclosed.example.com (Anonymous) Sat, 27 Nov 2021 13:26:11 +0000 Rust OOP sample https://w12.unix7.org/rust/hello Rust OOP sample /* * Author, Copyright: Oleg Borodin <onborodin@gmail.com> */ #[derive(Debug, Copy, Clone, Default)] struct Point { x: i32, y: i32 } //impl Default for Point{ // fn default() -> Point { // Point { // x: 2, // y: 4 // } // } //} impl Point { #[allow(dead_code)] fn new(x: i32, y: i32) -> Point { Point { x: x, y: y } } fn default() -> Point { Point { ..Default::default() } } fn set(&mu… anonymous@undisclosed.example.com (Anonymous) Sat, 27 Nov 2021 13:26:11 +0000