honeycomb_kernels/splits/
mod.rs1mod edge_multiple;
9mod edge_single;
10
11pub use edge_multiple::{splitn_edge, splitn_edge_transac};
12pub use edge_single::{split_edge, split_edge_transac};
13
14use honeycomb_core::{
15 attributes::AttributeError,
16 cmap::{LinkError, SewError},
17};
18
19#[derive(thiserror::Error, Debug, PartialEq, Eq)]
21pub enum SplitEdgeError {
22 #[error("core operation failed: {0}")]
24 FailedCoreOp(#[from] SewError),
25 #[error("vertex placement for split is not in ]0;1[")]
27 VertexBound,
28 #[error("edge isn't defined correctly")]
30 UndefinedEdge,
31 #[error("passed darts should be free & non-null - {0}")]
33 InvalidDarts(&'static str),
34 #[error("wrong # of darts - expected `{0}`, got {1}")]
37 WrongAmountDarts(usize, usize),
38}
39
40impl From<LinkError> for SplitEdgeError {
41 fn from(value: LinkError) -> Self {
42 Self::FailedCoreOp(value.into())
43 }
44}
45
46impl From<AttributeError> for SplitEdgeError {
47 fn from(value: AttributeError) -> Self {
48 Self::FailedCoreOp(value.into())
49 }
50}
51
52#[cfg(test)]
53mod tests;