flow_rs_core/layout/
mod.rs1use crate::error::Result;
4use crate::graph::Graph;
5
6pub trait LayoutAlgorithm<N, E> {
8 fn name(&self) -> &str;
10
11 fn apply(&mut self, graph: &mut Graph<N, E>) -> Result<()>;
13
14 fn is_running(&self) -> bool {
16 false
17 }
18
19 fn stop(&mut self) -> Result<()> {
21 Ok(())
22 }
23
24 fn progress(&self) -> f64 {
26 1.0
27 }
28
29 fn can_interrupt(&self) -> bool {
31 false
32 }
33}
34
35pub mod algorithms;
37pub mod utils;
38
39pub use algorithms::*;
40pub use utils::LayoutUtils;
41
42#[cfg(test)]
43mod tests;