#class #oop #elegant #tool #age #person #get-age

bobo

an elegant and powerful rust development tool library

2 releases

0.1.1 Sep 21, 2024
0.1.0 Sep 21, 2024

#3 in #person

Download history 265/week @ 2024-09-19 41/week @ 2024-09-26 6/week @ 2024-10-03 2/week @ 2024-10-10

314 downloads per month

MIT license

3KB

BOBO

an elegant and powerful rust development tool library

Quick Start

use bobo::oop::*;

class! {
    Person {
        name: String
        age: u32

        fn greet(){
            println!("{}", format!("Hello, my name is {}.", self.name));
        }

        fn get_age(years: u32) -> u32 {
            self.age + years
        }
    }
}

fn main() {

    let person = Person {
        name: String::from("Tom"),
        age: 30,
    };

    person.greet();

    println!("I am {} years old.", person.get_age(5));
}

Dependencies

~245–690KB
~17K SLoC