1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Types in this module are used to enforce compile time guarantees when interacting with
//! different InputKinds.
use PhantomData;
use ;
use crateInputBinding;
use crateInputAction;
;
;
;
;
/// A wrapper for `InputAction` that carries information about the `InputKind` it is.
///
/// The purpose of the wrapper is to provide compile-time guarantees that the `InputKind` is correct and you're not
/// accidentally using an `InputAction` in the wrong way.
///
/// # Examples
///
/// An instance can be obtained by using the `ineff!()` macro:
/// ```
/// # use bevy::prelude::KeyCode;
/// # use bevy_ineffable::phantom::{Continuous, IAWrp};
/// # use bevy_ineffable::prelude::*;
/// #[derive(InputAction)]
/// pub enum ExampleInput {
/// #[ineffable(continuous)]
/// Example,
/// }
/// let _: IAWrp<ExampleInput, Continuous> = ineff!(ExampleInput::Example);
/// ```
///
/// You typically shouldn't need to deal with this type directly.
/// However, if you ever need to unwrap it, do it like this:
/// ```
/// # use bevy::prelude::KeyCode;
/// # use bevy_ineffable::phantom::{Continuous, IAWrp};
/// # use bevy_ineffable::prelude::*;
/// # #[derive(InputAction)]
/// # pub enum ExampleInput {
/// # #[ineffable(continuous)]
/// # Example,
/// # }
/// let wrapped = ineff!(ExampleInput::Example);
/// let _: ExampleInput = wrapped.0;
/// ```
;
/// A wrapper for `InputBinding` that carries information about the `InputKind` it can be bound to.
///
/// This wrapper is used by the `InputConfigBuilder`, when creating an `InputConfig` programmatically. Its purpose is
/// to provide compile-time guarantees that the `InputKind` is correct and you're not accidentally using an
/// `InputAction` in the wrong way.
///
/// # Examples
///
/// An instance can be obtained by using one of the four builders:
/// ```
/// # use bevy::prelude::KeyCode;
/// # use bevy_ineffable::phantom::*;
/// # use bevy_ineffable::prelude::*;
/// let _ : IBWrp<DualAxis> = DualAxisBinding::builder().build();
/// let _ : IBWrp<SingleAxis> = SingleAxisBinding::hold().build();
/// let _ : IBWrp<Continuous> = ContinuousBinding::hold(KeyCode::Space);
/// let _ : IBWrp<Pulse> = PulseBinding::just_pressed(KeyCode::Space);
/// ```
;