pub struct Navigator {
pub mode: Mode,
/* private fields */
}Fields§
§mode: ModeImplementations§
pub fn new(start: NodeId) -> Self
pub fn current(&self) -> &str
Sourcepub fn leap(
&mut self,
dir: Direction,
positions: &impl Fn(&str) -> [f32; 2],
neighbors: &impl Fn(&str) -> Vec<(NodeId, [f32; 2])>,
)
pub fn leap( &mut self, dir: Direction, positions: &impl Fn(&str) -> [f32; 2], neighbors: &impl Fn(&str) -> Vec<(NodeId, [f32; 2])>, )
Directional leap. positions maps id->graph position; neighbors returns
(id, position) pairs for a node’s edge-connected neighbors.
Sourcepub fn sibling(
&mut self,
delta: i32,
positions: &impl Fn(&str) -> [f32; 2],
neighbors: &impl Fn(&str) -> Vec<(NodeId, [f32; 2])>,
)
pub fn sibling( &mut self, delta: i32, positions: &impl Fn(&str) -> [f32; 2], neighbors: &impl Fn(&str) -> Vec<(NodeId, [f32; 2])>, )
Slide to the next (+1) / previous (-1) sibling of the last leap.
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Any non-sibling action clears the sibling context.
Sourcepub fn set_current(&mut self, id: NodeId)
pub fn set_current(&mut self, id: NodeId)
Force the current node (e.g. continuity when switching from Focus mode).
Does not push history — this is a teleport, not a focus()-style leap.
pub fn back(&mut self)
Auto Trait Implementations§
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