pub struct FocusController {
pub focus: NodeId,
pub history: Vec<NodeId>,
pub candidates: Vec<Candidate>,
pub selection: usize,
/* private fields */
}Fields§
§focus: NodeId§history: Vec<NodeId>§candidates: Vec<Candidate>§selection: usizeImplementations§
Source§impl FocusController
impl FocusController
pub fn new(focus: NodeId, provider: &dyn DataProvider, limit: usize) -> Self
pub fn focus_on(&mut self, id: NodeId, provider: &dyn DataProvider)
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Whether the candidate list is currently just a pending placeholder — the neighborhood was requested but hadn’t arrived when it was last fetched.
Sourcepub fn refetch(&mut self, provider: &dyn DataProvider)
pub fn refetch(&mut self, provider: &dyn DataProvider)
Re-run the fetch for the current focus without disturbing focus/history. Called after an async cache fill resolves a neighborhood that was pending when this controller first fetched it; the provider now returns real data.
pub fn select(&mut self, delta: i32)
Sourcepub fn select_index(&mut self, i: usize) -> bool
pub fn select_index(&mut self, i: usize) -> bool
Move the selection to candidate i. Returns false — changing
nothing — when i is out of range or the candidate is a Loading
placeholder (inert by design, same as hit-testing). The id→index
resolution lives in graph-explorer-wasm, which mints the scene ids; this
method is deliberately just the bounds-checked cursor move.
Sourcepub fn candidates(&self) -> &[Candidate]
pub fn candidates(&self) -> &[Candidate]
Read-only view for hosts that resolve ids/indices — graph-explorer-wasm’s select_id.
pub fn descend(&mut self, provider: &dyn DataProvider) -> DescendOutcome
Sourcepub fn selected(&self) -> Option<SelectionInfo>
pub fn selected(&self) -> Option<SelectionInfo>
What is selected right now, or None when there are no candidates.