pub struct Mapping {
pub pattern: EventPattern,
pub target: Target,
pub transform: Transform,
pub name: String,
pub enabled: bool,
}Expand description
Маппинг события на параметр
Fields§
§pattern: EventPatternПаттерн события
target: TargetЦелевой параметр
transform: TransformПреобразование
name: StringНазвание (для отладки)
enabled: boolАктивен ли маппинг
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
Создать новый маппинг
Sourcepub fn matches(&self, event: &ControlEvent) -> bool
pub fn matches(&self, event: &ControlEvent) -> bool
Проверить, подходит ли событие под этот маппинг
Sourcepub fn apply(&self, event: &ControlEvent) -> Option<ParameterCommand>
pub fn apply(&self, event: &ControlEvent) -> Option<ParameterCommand>
Применить событие и получить команду для параметра
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