linkk 0.1.2

A crate for creating channels and crossing them to facilitate communication between different parts of a program.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 7.61 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • alphastrata

linkk

About:

This crate provides a simple way to make a set of channels and criss-cross them. This pattern is useful for getting things that are hard to get talking to each other to communicate.

Conceptually, it can be thought of as making a bridge, and it can be used to send any type of data across the channels.

There's almost certainly a nicer way of doing this... but, I dunno what that is.

Installation

Add this to your Cargo.toml:

[dependencies]

linkk = "0.1.2"

Usage:

Here is an example of how to use this crate:

use linkk::*;

setup_linkk!(pub, Window2os<u32>, Os2Window<u64>);

    let (link2, link1) = make_new_linkk();

    // link2 receives from link1
    link2.send(42).unwrap();
    assert_eq!(link1.recv().unwrap(), 42u32);

    // link1 receives from link2
    link1.tx.send(43 as u64).unwrap();
    assert_eq!(link2.rx.recv().unwrap(), 43);