You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
308 B
16 lines
308 B
3 years ago
|
use petgraph::prelude::*;
|
||
|
use crate::node;
|
||
|
use thiserror::Error;
|
||
|
|
||
|
#[derive(Error, Debug)]
|
||
|
pub enum NetworkError {
|
||
|
#[error("Error during node insertion")]
|
||
|
InsertionError(String)
|
||
|
}
|
||
|
|
||
|
pub trait Network {
|
||
|
fn add_node(&mut self, n: node::Node) -> Result<petgraph::graph::NodeIndex, NetworkError>;
|
||
|
}
|
||
|
|
||
|
|