pub struct Model {
pub rankdir: RankDir,
pub nodes: Vec<Node>,
pub edges: Vec<Edge>,
}Fields§
§rankdir: RankDir§nodes: Vec<Node>§edges: Vec<Edge>Implementations§
Source§impl Model
impl Model
pub fn new(rankdir: RankDir) -> Self
Sourcepub fn index_of(&self, id: &NodeId) -> Option<usize>
pub fn index_of(&self, id: &NodeId) -> Option<usize>
Index of a node by id, for engines that key on position.
Sourcepub fn foldable_of(&self, id: &NodeId) -> Option<String>
pub fn foldable_of(&self, id: &NodeId) -> Option<String>
The foldable group key of a node, if it is a group root. Only roots are
foldable; members and ordinary nodes return None.
Sourcepub fn collapse(&self, collapsed: &HashSet<String>) -> Model
pub fn collapse(&self, collapsed: &HashSet<String>) -> Model
The render view for a set of collapsed groups. Every foldable root gets a
fold marker (▾ open / ▸ … (N) closed); a collapsed group’s members and
the edges touching them are dropped, so only the root stays in the flow.
The root’s status reflects the worst of its members either way.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Model
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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> 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> ⓘ
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