pub struct GraphView { /* private fields */ }Implementations§
Source§impl GraphView
impl GraphView
pub fn new() -> Self
pub fn zoom(&self) -> Zoom
pub fn selected(&self) -> Option<&NodeId>
Sourcepub fn set_model(&mut self, model: Model)
pub fn set_model(&mut self, model: Model)
Replace the whole graph (topology changed). Keeps the selection if it survives.
Sourcepub fn patch_status(
&mut self,
updates: impl IntoIterator<Item = (NodeId, NodeStatus)>,
)
pub fn patch_status( &mut self, updates: impl IntoIterator<Item = (NodeId, NodeStatus)>, )
Update node statuses in place (e.g. a live CI poll) without changing topology, then re-lay out — positions stay put, colors/glyphs move.
pub fn set_zoom(&mut self, zoom: Zoom)
pub fn set_collapsed(&mut self, group: &str, collapsed: bool)
pub fn select(&mut self, id: &NodeId)
Sourcepub fn on_key(&mut self, key: KeyEvent) -> Option<GraphAction>
pub fn on_key(&mut self, key: KeyEvent) -> Option<GraphAction>
Handle a key. Returns an action the host should act on, or None.
Navigation/zoom/collapse are handled internally; Enter on a non-foldable
node yields Activated. Quit/back keys are the host’s concern.
Sourcepub fn on_mouse(&mut self, mouse: MouseEvent) -> Option<GraphAction>
pub fn on_mouse(&mut self, mouse: MouseEvent) -> Option<GraphAction>
Handle a mouse event: click selects (a leg wins over its container), double-click activates (fold or open), wheel pans.
pub fn render(&mut self, area: Rect, buf: &mut Buffer, theme: &GraphTheme)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GraphView
impl !Sync for GraphView
impl !UnwindSafe for GraphView
impl Forget for GraphView
impl Freeze for GraphView
impl Send for GraphView
impl Unpin for GraphView
impl UnsafeUnpin for GraphView
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