Struct dot_parser::subgraph_free::Graph
source · pub struct Graph<A> {
pub strict: bool,
pub is_digraph: bool,
pub name: Option<String>,
pub stmts: StmtList<A>,
}
Expand description
A graph, very similar to Ast::Graph, but can not contain subgraphs.
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.
stmts: StmtList<A>
The statements that describe the graph.
Implementations§
source§impl<A> Graph<A>
impl<A> Graph<A>
sourcepub fn filter_map<B>(self, f: &dyn Fn(A) -> Option<B>) -> Graph<B>
pub fn filter_map<B>(self, f: &dyn Fn(A) -> Option<B>) -> 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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