Skip to content

james-spears/btree_error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Tree Error (btree_error)

Branch Status

build test main
CodeBuild(build) CodeBuild(test) CodeBuild(main)

CodeBuild(main) 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.

About

A generic error enum

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages