pub struct TypeGraph {
pub nodes: HashMap<String, GraphNode>,
pub edges: Vec<GraphEdge>,
pub roots: Vec<String>,
}Expand description
A fully-traversed type graph ready for rendering.
Built by TypeGraph::from_root or TypeGraph::from_roots.
Nodes are stored in traversal order (breadth-first from root).
Fields§
§nodes: HashMap<String, GraphNode>All nodes encountered during traversal, keyed by node name.
edges: Vec<GraphEdge>Directed edges in traversal order.
roots: Vec<String>Root type names (in the order they were added).
Implementations§
Source§impl TypeGraph
impl TypeGraph
Sourcepub fn from_root(root: &str) -> Result<Self, TypeGraphError>
pub fn from_root(root: &str) -> Result<Self, TypeGraphError>
Walk from a single root type name.
Returns Err if the root type is not registered.
Sourcepub fn from_roots(roots: &[&str]) -> Result<Self, TypeGraphError>
pub fn from_roots(roots: &[&str]) -> Result<Self, TypeGraphError>
Walk from multiple root type names.
Returns Err if any root is not registered.
Sourcepub fn registered_types() -> Vec<&'static str>
pub fn registered_types() -> Vec<&'static str>
All registered graphable type names (convenience pass-through).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeGraph
impl RefUnwindSafe for TypeGraph
impl Send for TypeGraph
impl Sync for TypeGraph
impl Unpin for TypeGraph
impl UnsafeUnpin for TypeGraph
impl UnwindSafe for TypeGraph
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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