pub struct Graph<V> { /* fields omitted */ }
The graph drawing structure
Create a new Graph
for drawing
use rain::Graph;
let _: Graph<u8> = Graph::new();
Create a new Graph
for drawing with a custom length of the identifier
(prefix)
use rain::Graph;
let _: Graph<u8> = Graph::with_prefix_length(25);
Set the global log level for reporting
Add a data value to the graph by some identifier which can be displayed
somehow.
use rain::Graph;
let mut graph = Graph::new();
let line = graph.add("Line 1", 0).unwrap();
assert_eq!(line, "Line 1");
Remove a line from the graph
use rain::Graph;
let mut graph = Graph::new();
let line = graph.add("Line 1", 0).unwrap();
let removed_line = graph.remove(line).unwrap();
assert_eq!(removed_line, "Line 1");
Prints the graph
use rain::Graph;
let mut graph = Graph::new();
assert!(graph.add("Line 1", 0).is_ok());
assert!(graph.add("Line 2", 0).is_ok());
graph.print();
Print only if new data is available. Returns an indicator if somethings
was printed or not.
use rain::Graph;
let mut graph = Graph::new();
assert!(graph.add("Line 1", 0).is_ok());
assert!(graph.add("Line 2", 0).is_ok());
graph.print_if_new_data();
graph.print_if_new_data();
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static