pub struct Graph<A> {
pub strict: bool,
pub is_digraph: bool,
pub name: Option<String>,
pub attr: Vec<AttrStmt<A>>,
pub nodes: NodeSet<A>,
pub edges: EdgeSet<A>,
pub ideqs: Vec<IDEq>,
}
Expand description
A Graph
is a structure that can be created from a regular
Graph
, but that is more friendly to work with. For instance, in a Graph
,
attributes are most often given as a list of list of Attr
, while in a
Graph
, the lists are flatten.
Fields§
§strict: bool
Specifies if the Graph
is strict or not. A “strict” graph must not
contain the same edge multiple times. Notice that, for undirected edge,
an edge from A
to B
and an edge from B
to A
are equals.
is_digraph: bool
Specifies if the Graph
is directed.
name: Option<String>
The name of the Graph
, if any.
attr: Vec<AttrStmt<A>>
The global attributes of the graph.
nodes: NodeSet<A>
The nodes of the graph.
edges: EdgeSet<A>
The edges of the graph.
ideqs: Vec<IDEq>
The ID equalities declared in the graph.
Implementations§
Source§impl<A> Graph<A>
impl<A> Graph<A>
Sourcepub fn filter_map<F, B>(self, f: F) -> Graph<B>
pub fn filter_map<F, B>(self, f: F) -> Graph<B>
Filter and map attributes. The main intended usage of this function is
to convert attributes as &'a str
into an enum, e.g.
to convert ["label"="whatever", "color"="foo"]
into
[Attr::Label(whatever), Attr::Color(foo)]
.
To take into account non-standard attributes, the Attr
enum has to be
provided by the user.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Graph<A>
impl<A> RefUnwindSafe for Graph<A>where
A: RefUnwindSafe,
impl<A> Send for Graph<A>where
A: Send,
impl<A> Sync for Graph<A>where
A: Sync,
impl<A> Unpin for Graph<A>where
A: Unpin,
impl<A> UnwindSafe for Graph<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more