pub struct Mapping {
pub pattern: EventPattern,
pub target: Target,
pub transform: Transform,
pub name: String,
pub enabled: bool,
}Expand description
A mapping from an event pattern to a parameter target.
Fields§
§pattern: EventPatternEvent pattern to match.
target: TargetTarget parameter.
transform: TransformValue transformation.
name: StringHuman-readable name (for debugging).
enabled: boolWhether this mapping is active.
Implementations§
Source§impl Mapping
impl Mapping
Sourcepub fn new(pattern: EventPattern, target: Target, transform: Transform) -> Self
pub fn new(pattern: EventPattern, target: Target, transform: Transform) -> Self
Create a new mapping.
Sourcepub fn matches(&self, event: &ControlEvent) -> bool
pub fn matches(&self, event: &ControlEvent) -> bool
Check whether an event matches this mapping’s pattern.
Sourcepub fn apply(&self, event: &ControlEvent) -> Option<SetParameter>
pub fn apply(&self, event: &ControlEvent) -> Option<SetParameter>
Apply an event and produce a parameter command, if it matches.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mapping
impl !RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnsafeUnpin for Mapping
impl !UnwindSafe for Mapping
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