pretty_graph

Crates.iopretty_graph
lib.rspretty_graph
version0.6.0
created_at2026-01-15 08:27:27.457083+00
updated_at2026-01-22 05:33:03.837528+00
descriptionpretty_graph provides simple toolbox to build and working with graphs
homepagehttps://github.com/glabSdr/pretty_graph
repositoryhttps://github.com/glabSdr/pretty_graph
max_upload_size
id2044899
size30,885
Glab (glabSdr)

documentation

https://docs.rs/pretty_graph

README

Hello pretty_graph 🎀

pretty_graph provides simple toolbox to build and working with graphs.

Struct Node is main operation element - technically link to StrNodeBody (private struct).

StrNodeBody can contains key -> value fields. StrNodeBody supports only fields type &'static str.

StrNodeBody can contains key -> Node fields.

Simple example to start

    use pretty_graph::Node;

    fn main() {
        let node_1 = Node::from(None, None);
        node_1.set("key1", "value1");
        node_1.set("key2", "value2");

        let node_2 = Node::new();
        node_2.link("node_1", node_1);

        let node_3 = Node::new();
        node_3.link("node_2", node_2);

        match node_3.node_by_chain(vec!["node_2", "node_1"]) {
            Some(node_1) => {
                for k in node_1.keys().iter() {
                    println!("{:?}", node_1.get(k).unwrap());
                }
            },
            None => println!("No node found by path: [\"node_2\", \"node_1\"]")
        }
    }

Multithread Case

fn main() {
    let node = Node::new();
    node.set("key", "value");

    std::thread::spawn(move || {
        println!("{:?}", node.get("key"))
    });

    sleep(Duration::from_millis(100));
}
Commit count: 12

cargo fmt