wildbird 0.0.3

Rust Framework
Documentation

Table of contents

Services

Create service instance (Singleton) in one step

use wildbird::derive::*;

// Convert struct to Service + impl construct()

#[service(construct = "init")]
struct HelloService {
    component_name: String,
}

impl HelloService {
    fn init() -> HelloService {
        HelloService {
            component_name: "Hello penguins 🐧".to_string(),
        }
    }

    fn sey_hello(&self) {
        println!("Hello! 👋")
    }
}

fn main() {
    HelloService.sey_hello();
}
use wildbird::derive::*;

// Convert struct to Service
#[service]
struct HelloService {
    component_name: String,
}

// Impl Service trait construct() 
#[service(construct)]
fn hello_init() -> HelloService {
    HelloService {
        component_name: "Hello 🚀".to_string(),
    }
}

Created By

License

MIT