Skip to main content

Graph

Struct Graph 

Source
pub struct Graph {
Show 15 fields pub name: String, pub strict: bool, pub kind: GraphKind, pub graph_attrs: AttrMap, pub node_defaults: AttrMap, pub edge_defaults: AttrMap, pub nodes: Vec<NodeData>, pub node_lookup: BTreeMap<String, NodeId>, pub edges: Vec<EdgeData>, pub subgraphs: Vec<SubgraphData>, pub bb: BoundingBox, pub html_strings: BTreeSet<String>, pub anon_subgraph_ids: BTreeMap<u32, u64>, pub dicts: Vec<AttrDicts>, pub render_view: Option<Box<Graph>>,
}
Expand description

Arena-backed Graph representation (Fixes GV-BUG-008 and GV-BUG-010).

Fields§

§name: String§strict: bool§kind: GraphKind§graph_attrs: AttrMap§node_defaults: AttrMap§edge_defaults: AttrMap§nodes: Vec<NodeData>§node_lookup: BTreeMap<String, NodeId>§edges: Vec<EdgeData>§subgraphs: Vec<SubgraphData>§bb: BoundingBox§html_strings: BTreeSet<String>

Attribute values that were written as HTML strings (<...>) in the source, stored with their delimiters. A quoted "<x>" is a plain string and is not recorded here.

§anon_subgraph_ids: BTreeMap<u32, u64>

cgraph’s internal ids of anonymous subgraphs (subgraph index -> id); the root graph, anonymous subgraphs and edges draw odd ids from one counter in creation order. C prints an anonymous subgraph’s name as %<id>.

§dicts: Vec<AttrDicts>

cgraph attribute dictionaries (Agdatadict_t) as built while parsing: index 0 is the root graph, index i + 1 subgraph i. Writers that reproduce agwrite use them to tell local declarations from inherited values.

§render_view: Option<Box<Graph>>

The graph as renderers that run before undoClusterEdges see it: fdp leaves its cluster nodes (__0:cluster) and cloned cluster edges in the graph it lays out, and only the output writers (dot, xdot, json, canon, plain) undo them. -Tsvg draws this graph when it is set.

Implementations§

Source§

impl Graph

Source

pub fn new(name: impl Into<String>, kind: GraphKind, strict: bool) -> Self

Source

pub fn ensure_node(&mut self, name: &str) -> NodeId

Source

pub fn add_edge(&mut self, tail: NodeId, head: NodeId, attrs: AttrMap) -> EdgeId

Trait Implementations§

Source§

impl Clone for Graph

Source§

fn clone(&self) -> Graph

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Graph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Graph

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Graph

Source§

fn eq(&self, other: &Graph) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Graph

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Graph

Auto Trait Implementations§

§

impl Freeze for Graph

§

impl RefUnwindSafe for Graph

§

impl Send for Graph

§

impl Sync for Graph

§

impl Unpin for Graph

§

impl UnsafeUnpin for Graph

§

impl UnwindSafe for Graph

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.