read_json_format_digraph

Function read_json_format_digraph 

Source
pub fn read_json_format_digraph<N, E, P>(
    path: P,
    weighted: bool,
) -> Result<DiGraph<N, E>>
where N: Node + Debug + FromStr + Clone, E: EdgeWeight + Copy + Debug + Default + FromStr, P: AsRef<Path>,
Expand description

Read a directed graph from JSON format

§Arguments

  • path - Path to the input file
  • weighted - Whether to parse edge weights from the JSON

§Returns

  • Ok(DiGraph) - The directed graph read from the file
  • Err(GraphError) - If there was an error reading or parsing the file