pub struct TraversalCursor {
pub position: BlockId,
pub neighborhood: CursorNeighborhood,
pub breadcrumbs: VecDeque<BlockId>,
pub view_mode: ViewMode,
/* private fields */
}Expand description
Represents an agent’s current position and view in the graph.
Fields§
§position: BlockIdCurrent focus block.
neighborhood: CursorNeighborhoodVisible neighborhood (cached expansion).
Breadcrumb trail for navigation.
view_mode: ViewModeCurrent view mode.
Implementations§
Source§impl TraversalCursor
impl TraversalCursor
pub fn new(position: BlockId, max_breadcrumbs: usize) -> Self
Sourcepub fn can_go_back(&self) -> bool
pub fn can_go_back(&self) -> bool
Check if we can go back.
Sourcepub fn history_depth(&self) -> usize
pub fn history_depth(&self) -> usize
Get the number of steps we can go back.
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear navigation history.
Sourcepub fn update_neighborhood(&mut self, neighborhood: CursorNeighborhood)
pub fn update_neighborhood(&mut self, neighborhood: CursorNeighborhood)
Update the neighborhood cache.
Sourcepub fn needs_refresh(&self) -> bool
pub fn needs_refresh(&self) -> bool
Check if neighborhood needs refresh.
Trait Implementations§
Source§impl Clone for TraversalCursor
impl Clone for TraversalCursor
Source§fn clone(&self) -> TraversalCursor
fn clone(&self) -> TraversalCursor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TraversalCursor
impl RefUnwindSafe for TraversalCursor
impl Send for TraversalCursor
impl Sync for TraversalCursor
impl Unpin for TraversalCursor
impl UnwindSafe for TraversalCursor
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