Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
clingo-rs
Rust bindings to the clingo library. Clingo version 5.5.0.
Requirements
- a c++14 conforming compiler
Per default the crate uses the clingo library via dynamic linking.
It is assumed that a clingo dynamic library is installed on the system.
You have to set the environment variable CLINGO_LIBRARY_PATH
. For example:
Examples
Features
Using derive
macro
The crate provides a derive macro to help easing the use of rust data types as facts.
In your Cargo.toml
add:
[]
= { = "0.7.0", = ["derive"] }
In your source write:
use clingo::ToSymbol;
use clingo::ClingoError;
use clingo::FactBase;
#[derive(ToSymbol)]
struct MyPoint {
x: i32,
y: i32,
}
let p = MyPoint{ x:4, y:2 };
let fb = FactBase::new();
fb.insert(p);
The macro performs a conversion to snake case. This means the corresponing fact for MyPoint{x:4,y:2}
is my_point(4,2)
.
Using static-linking
You can use the clingo library via static linking.
The recommended way to use the optional static linking support is as follows.
[]
= { = "0.7.0", = ["static-linking"] }
Contribution
How to make a contribution to clingo-rs
?
Any contribution intentionally submitted for inclusion in the work by you, shall be licensed under the terms of the MIT license without any additional terms or conditions.