Guess I should put this under version control LOL

This commit is contained in:
Ryan McGrath 2019-05-23 22:11:07 -07:00
commit 2035318460
No known key found for this signature in database
GPG key ID: 811674B62B666830
73 changed files with 8836 additions and 0 deletions

35
styles/src/stretch/mod.rs Normal file
View file

@ -0,0 +1,35 @@
pub mod geometry;
pub mod node;
pub mod number;
pub mod result;
mod algo;
mod id;
pub use crate::node::Stretch;
use core::any::Any;
#[derive(Debug)]
pub enum Error {
InvalidNode(node::Node),
Measure(Box<Any>),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match *self {
Error::InvalidNode(ref node) => write!(f, "Invalid node {:?}", node),
Error::Measure(_) => write!(f, "Error during measurement"),
}
}
}
impl std::error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::InvalidNode(_) => "The node is not part of the stretch instance",
Error::Measure(_) => "Error occurred inside a measurement function",
}
}
}