radiowave

Crates.ioradiowave
lib.rsradiowave
version2.0.0
sourcesrc
created_at2023-10-19 01:22:24.425862
updated_at2023-12-09 21:13:59.013034
descriptionA library for emitting signals across the entire program.
homepage
repositoryhttps://gitlab.com/oglo-crates/radiowave
max_upload_size
id1007380
size6,455
Jackson Novak (Oglo12)

documentation

README

RadioWave

A Rust crate for emitting signals across the entire program.

Examples

use radiowave::*;

enum Channel {
    AppEvents = 0,
}

fn main() {
    let station = RadioStation::new(Channel::AppEvents as usize);

    if station.signal_exists("saycow") == false {
        println!("Hmmmm... let us say moooooo!");

        station.send_signal("saycow", "Mooooo! Says the cow.").unwrap(); // This statement fails if the signal already exists.
    }

    else {
        println!("Cancelling signal!");

        station.cancel_signal_if_exists("saycow");
    }
}

fn moo() {
    let station = RadioStation::new(Channel::AppEvents as usize);

    let what_does_the_cow_say: String = station.wait_for_signal("saycow");

    println!("The cow says: {}", what_does_the_cow_say);
}
Commit count: 9

cargo fmt