Skip to content
/ ent Public

Abstract object library w/ impls for JSON, Python, & more.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

nkconnor/ent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ent   Build Crate

Ent is an abstract object library. Using Rust's monomorphization, you can write zero cost interfaces across multiple object types including JSON and Python dictionaries. If you are interested in contributing to Ent, please do! We would welcome any help including additional object implementations.

Warning: this is in early development and there may be a more generic approach to this problem that utilizes e.g. serde's Visitor in order to apply to a large number of object-like formats. See also dict_derive from the Pyo3 ecosystem.

Getting Started

[dependencies]

# Specify supported implementations using feature keys:
#  - python
#  - json
ent = { version = "0.1", features = ["python"] }

Examples

use ent::Ent;

fn get_name<E: Ent>(e: &E) -> Result<&str> {
    e.get("name").unwrap().as_str()
}

let v: serde_json::Value = serde_json::from_str(r#"{"name":"test"}"#).unwrap();
let ref name = get_name(&v).unwrap();
assert_eq!(name, &"test")

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Ent by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Abstract object library w/ impls for JSON, Python, & more.

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