pub struct DeclinePeel { /* private fields */ }Expand description
The layer-peeling walk behind a declined chord.
Hold one across the re-resolution loop: each peel removes
the single layer that produced the declining binding and hands back the
reduced set to re-translate against. The caller translates and applies;
this decides what to translate against and when to stop.
Implementations§
Source§impl DeclinePeel
impl DeclinePeel
Sourcepub fn new(
modal: ModalState,
prefix: Vec<KeyChord>,
chord: KeyChord,
layers: Vec<ModeId>,
) -> Self
pub fn new( modal: ModalState, prefix: Vec<KeyChord>, chord: KeyChord, layers: Vec<ModeId>, ) -> Self
prefix is the partial chord as it stood before the declined
dispatch — the sequence this chord completes, not what the dispatch
left behind.
Sourcepub fn peel(&mut self, keymap: &KeymapHandle) -> Option<&[ModeId]>
pub fn peel(&mut self, keymap: &KeymapHandle) -> Option<&[ModeId]>
Drop the layer that produced the declining binding, and yield the reduced layer set to re-translate against.
None means there is nothing left to peel: the winning binding came
from the always-on Builtin / User layers, which cannot decline. The
walk is bounded — every pass removes exactly one layer.
Sourcepub fn prefix(&self) -> &[KeyChord]
pub fn prefix(&self) -> &[KeyChord]
The sequence this chord completes. Re-translation uses it, so a declined multi-key chord re-resolves as the sequence it was.
pub fn chord(&self) -> KeyChord
pub fn layers(&self) -> &[ModeId]
pub fn binding_mode(&self) -> BindingMode
Trait Implementations§
Source§impl Clone for DeclinePeel
impl Clone for DeclinePeel
Source§fn clone(&self) -> DeclinePeel
fn clone(&self) -> DeclinePeel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DeclinePeel
impl RefUnwindSafe for DeclinePeel
impl Send for DeclinePeel
impl Sync for DeclinePeel
impl Unpin for DeclinePeel
impl UnsafeUnpin for DeclinePeel
impl UnwindSafe for DeclinePeel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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