pub enum GraphFormat {
Edgelist,
Ncol,
Lgl,
Pajek,
GraphMl,
Gml,
DimacsFlow,
GraphDb,
Dl,
Dot,
Leda,
}Expand description
Graph file formats known to igraph, for the format-agnostic
Graph::read_graph and Graph::write_graph.
The variants list the file extensions recognized by
from_path; can_read and
can_write tell which direction the generic functions
support.
Variants§
Edgelist
Plain edge list of 0-based vertex ids (.txt, .edgelist, .edges, .el).
Ncol
NCOL symbolic edge list (.ncol).
Lgl
LGL format (.lgl).
Pajek
Pajek (.net, .pajek).
GraphMl
GraphML (.graphml, .xml).
Gml
GML (.gml).
DimacsFlow
DIMACS flow format (.dimacs, .max); only Graph::read_graph
supports it generically (it discards the problem data).
GraphDb
Binary ARG graph database format (.graphdb, and the .A00….A99,
.B00….B99 suffixes of the database’s graph pairs); read only.
Dl
UCINET DL (.dl); read only.
Dot
Graphviz DOT (.dot, .gv); write only.
Leda
LEDA native format (.gw, .leda); write only.
Implementations§
Source§impl GraphFormat
impl GraphFormat
Sourcepub fn from_path(path: impl AsRef<Path>) -> Option<Self>
pub fn from_path(path: impl AsRef<Path>) -> Option<Self>
Guesses the format from the extension of path (case insensitive),
or None if the extension is unknown.
use igraph::foreign::GraphFormat;
assert_eq!(GraphFormat::from_path("karate.GML"), Some(GraphFormat::Gml));
assert_eq!(GraphFormat::from_path("/tmp/g.net"), Some(GraphFormat::Pajek));
assert_eq!(GraphFormat::from_path("noext"), None);Sourcepub fn can_write(self) -> bool
pub fn can_write(self) -> bool
Whether igraph can write this format (DIMACS needs extra data: use
Graph::write_graph_dimacs_flow directly).
Trait Implementations§
Source§impl Clone for GraphFormat
impl Clone for GraphFormat
Source§fn clone(&self) -> GraphFormat
fn clone(&self) -> GraphFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GraphFormat
Source§impl Debug for GraphFormat
impl Debug for GraphFormat
impl Eq for GraphFormat
Source§impl Hash for GraphFormat
impl Hash for GraphFormat
Source§impl PartialEq for GraphFormat
impl PartialEq for GraphFormat
Source§fn eq(&self, other: &GraphFormat) -> bool
fn eq(&self, other: &GraphFormat) -> bool
self and other values to be equal, and is used by ==.