Skip to content
Proc macro attributes for Bastion runtime.
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
examples
src
.gitignore
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md

README.md

Fort

Fort is proc macro attribute crate for Bastion.

Usage

[dependencies]
fort = "0.1"
bastion = "0.2.*"

You can directly use fort to load work onto the root supervisor with:

#[fort::root]
fn main() {
    println!("Running in Bastion runtime!");
}

Make your program fault-tolerant with fort:

#[fort::root]
fn main() {
    loop {
        println!("Undying main!");
        panic!("Error")
    }
}

Example TCP Server

use std::io::Write;
use std::net::TcpListener;

#[fort::root]
fn main() {
    let listener = TcpListener::bind("127.0.0.1:2278").unwrap();
    println!("TCP server started at 127.0.0.1:2278");
    for stream in listener.incoming() {
        let mut stream = stream.unwrap();
        stream.write(b"Hello World\r\n").unwrap();
        panic!("Fail here!");
    }
}
You can’t perform that action at this time.