pub struct ChildView {
pub chord: KeyChord,
pub binding: Option<Arc<BoundCommand>>,
pub descendants: usize,
}Expand description
WK.1: one immediate child of a trie node, as which-key sees it.
Owned, not borrowed. The composite trie
KeymapHandle::continuations_with_context folds is a local temporary
(lookup_with_context builds one per call), so a view holding
&TrieNode could not outlive the fold. Owning also keeps TrieNode
private, which it is today.
Fields§
§chord: KeyChordThe chord that descends to this child. For the wildcard slot this
is meaningless and the caller reads NodeView::wildcard instead.
binding: Option<Arc<BoundCommand>>The binding sitting AT the child, if it is a terminal node.
descendants: usizeHow many bindings live strictly BELOW the child. Non-zero means
the child is itself a prefix; which-key renders +N.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChildView
impl RefUnwindSafe for ChildView
impl Send for ChildView
impl Sync for ChildView
impl Unpin for ChildView
impl UnsafeUnpin for ChildView
impl UnwindSafe for ChildView
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