pub struct BindingMapper<Code> { /* private fields */ }Expand description
Configurable mapping from (ControlId, EventSelector) to downstream events.
Multiple bindings may be registered for the same key. They are emitted in registration order. Unmapped events intentionally produce no output.
Implementations§
Source§impl<Code> BindingMapper<Code>
impl<Code> BindingMapper<Code>
pub fn new(source: SourceId) -> Self
pub fn with_initial_sequence(source: SourceId, next_sequence: u64) -> Self
pub const fn source(&self) -> SourceId
Sourcepub const fn next_sequence(&self) -> Option<u64>
pub const fn next_sequence(&self) -> Option<u64>
Sequence which will be assigned next, or None after u64::MAX was used.
Sourcepub fn bind(
&mut self,
control: ControlId,
selector: EventSelector,
code: Code,
value: InputValue,
) -> &mut Self
pub fn bind( &mut self, control: ControlId, selector: EventSelector, code: Code, value: InputValue, ) -> &mut Self
Append a binding for (control, selector).
Sourcepub fn with_binding(
self,
control: ControlId,
selector: EventSelector,
code: Code,
value: InputValue,
) -> Self
pub fn with_binding( self, control: ControlId, selector: EventSelector, code: Code, value: InputValue, ) -> Self
Fluent, ownership-taking form of Self::bind.
Sourcepub fn bind_auto(
&mut self,
control: ControlId,
selector: EventSelector,
code: Code,
) -> &mut Self
pub fn bind_auto( &mut self, control: ControlId, selector: EventSelector, code: Code, ) -> &mut Self
Append a binding whose value is derived from the matched event.
pub fn binding_count(&self) -> usize
Trait Implementations§
Source§impl<Code: Clone> Clone for BindingMapper<Code>
impl<Code: Clone> Clone for BindingMapper<Code>
Source§fn clone(&self) -> BindingMapper<Code>
fn clone(&self) -> BindingMapper<Code>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Code: Debug> Debug for BindingMapper<Code>
impl<Code: Debug> Debug for BindingMapper<Code>
Source§impl<Code> EventMapper for BindingMapper<Code>where
Code: Clone,
impl<Code> EventMapper for BindingMapper<Code>where
Code: Clone,
Auto Trait Implementations§
impl<Code> Freeze for BindingMapper<Code>
impl<Code> RefUnwindSafe for BindingMapper<Code>where
Code: RefUnwindSafe,
impl<Code> Send for BindingMapper<Code>where
Code: Send,
impl<Code> Sync for BindingMapper<Code>where
Code: Sync,
impl<Code> Unpin for BindingMapper<Code>where
Code: Unpin,
impl<Code> UnsafeUnpin for BindingMapper<Code>
impl<Code> UnwindSafe for BindingMapper<Code>where
Code: UnwindSafe,
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