btree_error

Crates.iobtree_error
lib.rsbtree_error
version0.1.0
sourcesrc
created_at2021-01-29 21:27:46.61864
updated_at2021-01-29 21:27:46.61864
descriptionTo avoid duplication, all bforest libs use the same error defined in this crate.
homepagehttps://github.com/jameone/btree_error
repositoryhttps://github.com/jameone/btree_error
max_upload_size
id348243
size20,209
James Spears (jameone)

documentation

README

Binary Tree Error (btree_error)

CodeBuild Version badge Docs badge

To reduce repeated implementations of a simple error enum, this crate has been separated from the bforest crates.

Example

use btree_error::Error;
use btree_graph::BTreeGraph;

fn main() {
    let mut graph: BTreeGraph<String, String> = BTreeGraph::new();
    // Add nodes.
    graph.add_vertex(String::from("Tarzan"));
    graph.add_vertex(String::from("Jane"));
    // Add a relationship.
    let err: Error = graph.add_edge(String::from("Tarzan"), String::from("Sabor"), String::from("Hates")).unwrap_err();

    // Assert error was returned.
    assert_eq!(err, Error::VertexDoesNotExist);
}

Usage

It is doubtful anyone will use this crate by itself, but for completeness, add the following to your Cargo.toml file:

[dependencies]
btree_error = "0.1.0"

Implementation

Please see the API for a the full definition.

License

This work is dually licensed under MIT OR Apache-2.0.

Commit count: 8

cargo fmt