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>

source

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§

source§

impl<A> From<Graph<A>> for Graph<A>
where A: Clone,

source§

fn from(g: Graph<A>) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.