input
Generated Rust API reference for byte_engine.
Module input
Device-independent input actions, collected once and pulled by layered sinks.
Input runs in two steps. Every source event, whether a window key, a mouse
button, a gamepad control, or a replayed sample, is recorded into one
InputCollector. Then each consumer owns an InputSink that declares
its actions and pulls them from the collector once per tick. The sink's
consumer answers Capture::Captured for the actions it handles, which
keeps the source event from reaching later sinks. That is how a UI takes a
click before gameplay sees it.
Typical headed applications call setup_default_input, let
GraphicsApplication record window and gamepad events, and declare
Action values through
GraphicsApplication::world.
Applications that layer input own the collector and its sinks; translate
window events with process_default_window_input. Use utils to
register the standard mouse, keyboard, or gamepad classes.
Value is the erased value passed through the runtime; typed action
declarations use action::InputValue to constrain supported value types.
See Respond to input for the action and sink workflow, and Input for the device, trigger, and action model.
Contents
Quick Reference
| Item | Kind | Description |
|---|---|---|
Axis2 | struct | |
Axis3 | struct | |
InputCollector | struct | |
SinkHandle | struct | |
SourceEvent | struct | |
SeatHandle | struct | |
InputSink | struct | |
ResolvedAction | struct | |
ValueMapping | struct | The ValueMapping struct binds a trigger value to the transform used before action evaluation. |
ActionEvent | struct | The ActionEvent struct carries resolved action input to application code. |
Capture | enum | |
Types | enum | The [Types] enum identifies the value representation accepted by input triggers and actions. |
Value | enum | The [Value] enum carries device and action values through the non-generic input runtime. |
Function | enum | The Function enum identifies how an input value is transformed before it reaches an action. |
TickPolicy | enum | The TickPolicy enum controls how frequently an action emits events through the event channel. |
ActionPhase | enum | Identifies the stage of an input interaction. |
Extract | trait | The Extract trait recovers typed values from the input runtime's erased [Value] representation. |
Structs
Axis2
struct Axis2 {
pub x: f32,
pub y: f32,
}Defined in crates/byte-engine/src/input/axis.rs:13-18
The Axis2 struct carries a two-channel input value such as a mouse delta or gamepad stick.
Use Axis2 for device-relative values passed through super::Value. It
deliberately has no world-space meaning. Next, use it in a
super::trigger::TriggerDescription or an action super::ValueMapping.
Fields
-
x:f32The horizontal input channel.
-
y:f32The vertical input channel.
Implementations
-
const fn new(x: f32, y: f32) -> SelfCreates a two-channel input value from its horizontal and vertical components.
-
const fn zero() -> SelfReturns the neutral two-channel input value.
-
fn normalized(self) -> SelfScales a non-zero axis to unit length while preserving a neutral axis.
Trait Implementations
impl Add for Axis2
-
type Output = Axis2 -
fn add(self, rhs: Self) -> <Self as >::Output
impl ArchivePointee for Axis2
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Axis2
impl Clone for Axis2
-
fn clone(&self) -> Axis2Related:
Axis2
impl Copy for Axis2
impl Debug for Axis2
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for Axis2
-
fn default() -> Axis2Related:
Axis2
impl Downcast for Axis2
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Axis2
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Extract for Value
-
fn extract(&self) -> Axis2Related:
Axis2
impl Instrument for Axis2
impl LayoutRaw for Axis2
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Axis2
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Axis2
-
fn eq(&self, other: &Axis2) -> boolRelated:
Axis2
impl Pointee for Axis2
-
type Metadata = ()
impl Read for Axis2
impl<R> ReadPrimitive for Axis2
impl StructuralPartialEq for Axis2
impl WithSubscriber for Axis2
Axis3
struct Axis3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Defined in crates/byte-engine/src/input/axis.rs:57-64
The Axis3 struct carries a three-channel input value such as a headset position or directional command.
Use Axis3 for device-relative values passed through super::Value. It
deliberately has no world-space meaning. Next, use it in a
super::trigger::TriggerDescription or an action super::ValueMapping.
Fields
-
x:f32The first input channel, conventionally horizontal.
-
y:f32The second input channel, conventionally vertical.
-
z:f32The third input channel, conventionally depth.
Implementations
-
const fn new(x: f32, y: f32, z: f32) -> SelfCreates a three-channel input value from its components.
-
const fn zero() -> SelfReturns the neutral three-channel input value.
-
fn normalized(self) -> SelfScales a non-zero axis to unit length while preserving a neutral axis.
Trait Implementations
impl Add for Axis3
-
type Output = Axis3 -
fn add(self, rhs: Self) -> <Self as >::Output
impl ArchivePointee for Axis3
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Axis3
impl Clone for Axis3
-
fn clone(&self) -> Axis3Related:
Axis3
impl Copy for Axis3
impl Debug for Axis3
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for Axis3
-
fn default() -> Axis3Related:
Axis3
impl Downcast for Axis3
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Axis3
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Extract for Value
-
fn extract(&self) -> Axis3Related:
Axis3
impl Instrument for Axis3
impl LayoutRaw for Axis3
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl Mul for Axis3
-
type Output = Axis3 -
fn mul(self, rhs: Self) -> <Self as >::Output
impl<T, N1> Niching for Axis3
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Axis3
-
fn eq(&self, other: &Axis3) -> boolRelated:
Axis3
impl Pointee for Axis3
-
type Metadata = ()
impl Read for Axis3
impl<R> ReadPrimitive for Axis3
impl StructuralPartialEq for Axis3
impl WithSubscriber for Axis3
InputCollector<A: Allocator + Clone>
struct InputCollector<A: Allocator + Clone> {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/input/collector.rs:67-70
The InputCollector struct is where every source event ends up before sinks act on it.
Register controls with Self::register_trigger, create devices with
Self::create_device, and queue their values with Self::record. Take
one SinkHandle per sink with Self::add_sink. Each tick, let the sinks
pull in priority order. Every sink must keep pulling: records stay queued
until the last sink has pulled past them.
Implementations
-
fn new() -> SelfCreates an empty collector. Next, register controls with
Self::register_trigger.
Trait Implementations
impl ArchivePointee for InputCollector<A>
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for InputCollector<A>
impl<A: Allocator + Clone + Default> Default for InputCollector<A>
-
fn default() -> Self
impl Downcast for InputCollector<A>
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for InputCollector<A>
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for InputCollector<A>
impl LayoutRaw for InputCollector<A>
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for InputCollector<A>
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for InputCollector<A>
-
type Metadata = ()
impl Read for InputCollector<A>
impl<R> ReadPrimitive for InputCollector<A>
impl WithSubscriber for InputCollector<A>
SinkHandle
struct SinkHandle();Defined in crates/byte-engine/src/input/collector.rs:26
The SinkHandle struct identifies one sink pulling from a collector.
Take one per sink from InputCollector::add_sink and give it to that
sink's InputSink. The order sinks pull in decides
their priority.
Trait Implementations
impl ArchivePointee for SinkHandle
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SinkHandle
impl Clone for SinkHandle
-
fn clone(&self) -> SinkHandleRelated:
SinkHandle
impl Copy for SinkHandle
impl Debug for SinkHandle
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for SinkHandle
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for SinkHandle
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for SinkHandle
impl<K> Equivalent for SinkHandle
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for SinkHandle
impl LayoutRaw for SinkHandle
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SinkHandle
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for SinkHandle
-
fn eq(&self, other: &SinkHandle) -> boolRelated:
SinkHandle
impl Pointee for SinkHandle
-
type Metadata = ()
impl Read for SinkHandle
impl StructuralPartialEq for SinkHandle
impl WithSubscriber for SinkHandle
SourceEvent
struct SourceEvent {
pub seat_handle: super::SeatHandle,
pub device_handle: super::DeviceHandle,
pub trigger_handle: super::TriggerHandle,
pub value: super::Value,
pub sequence: u64,
}Defined in crates/byte-engine/src/input/collector.rs:47-58
The SourceEvent struct provides a serializable control sample for remote input replay.
Read pending samples with InputCollector::source_events and serialize
them with Facet. Handles identify the sender's registry: map the seat,
device, and trigger to the receiver's registered handles before calling
InputCollector::record. Preserve arrival order; sequence numbers let the
transport detect duplicates or gaps but do not provide timestamps.
Fields
-
seat_handle:super::SeatHandleThe sender's player seat.
-
device_handle:super::DeviceHandleThe sender's concrete input device.
-
trigger_handle:super::TriggerHandleThe sender's registered control.
-
value:super::ValueThe recorded control value.
-
sequence:u64The increasing arrival sequence within the sender's input queue.
Trait Implementations
impl ArchivePointee for SourceEvent
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SourceEvent
impl Clone for SourceEvent
-
fn clone(&self) -> SourceEventRelated:
SourceEvent
impl Copy for SourceEvent
impl Debug for SourceEvent
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for SourceEvent
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for SourceEvent
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Facet for SourceEvent
-
const SHAPE: &'static ::facet::Shape
impl Instrument for SourceEvent
impl LayoutRaw for SourceEvent
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SourceEvent
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for SourceEvent
-
fn eq(&self, other: &SourceEvent) -> boolRelated:
SourceEvent
impl Pointee for SourceEvent
-
type Metadata = ()
impl Read for SourceEvent
impl StructuralPartialEq for SourceEvent
impl WithSubscriber for SourceEvent
SeatHandle
struct SeatHandle();Defined in crates/byte-engine/src/input/seat.rs:3
The SeatHandle struct identifies the player seat associated with input.
Implementations
-
fn stub() -> SelfReturns the placeholder seat used until platform input seats are wired through.
Trait Implementations
impl ArchivePointee for SeatHandle
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SeatHandle
impl Clone for SeatHandle
-
fn clone(&self) -> SeatHandleRelated:
SeatHandle
impl Copy for SeatHandle
impl Debug for SeatHandle
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for SeatHandle
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for SeatHandle
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for SeatHandle
impl<K> Equivalent for SeatHandle
-
fn equivalent(&self, key: &K) -> bool
impl Facet for SeatHandle
-
const SHAPE: &'static ::facet::Shape
impl Hash for SeatHandle
-
fn hash<__H: hash::Hasher>(&self, state: &mut __H)
impl Instrument for SeatHandle
impl LayoutRaw for SeatHandle
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SeatHandle
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for SeatHandle
-
fn eq(&self, other: &SeatHandle) -> boolRelated:
SeatHandle
impl Pointee for SeatHandle
-
type Metadata = ()
impl Read for SeatHandle
impl StructuralPartialEq for SeatHandle
impl WithSubscriber for SeatHandle
InputSink<A: Allocator + Clone>
struct InputSink<A: Allocator + Clone> {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/input/sink.rs:61-72
The InputSink struct turns one consumer's share of the input into its actions.
Create it with the SinkHandle of its consumer, declare actions with
Self::create_action or Self::with_declarations, then call
Self::pull once per tick before lower-priority sinks pull. Use
Self::cancel_action, Self::cancel_seat, or Self::cancel_device
when the consumer loses focus while holding a control.
See Respond to input for the layered input workflow.
Implementations
-
fn new(handle: SinkHandle, channel: DefaultChannel<ActionEvent>) -> SelfRelated:
SinkHandle,ActionEventCreates a sink that publishes its actions through
channel.Next, add actions with
Self::create_action, or adopt declared ones with
Trait Implementations
impl ArchivePointee for InputSink<A>
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for InputSink<A>
impl Downcast for InputSink<A>
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for InputSink<A>
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for InputSink<A>
impl LayoutRaw for InputSink<A>
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for InputSink<A>
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for InputSink<A>
-
type Metadata = ()
impl Read for InputSink<A>
impl WithSubscriber for InputSink<A>
ResolvedAction
struct ResolvedAction {
pub action: super::ActionHandle,
pub handle: Option<crate::core::factory::Handle>,
pub value: super::Value,
pub phase: super::ActionPhase,
}Defined in crates/byte-engine/src/input/sink.rs:26-35
The ResolvedAction struct lets a sink's consumer decide whether to capture an action.
The consumer receives it during InputSink::pull and answers with a Capture.
Fields
-
action:super::ActionHandleThe action's index in its own sink.
-
handle:Option<crate::core::factory::Handle>The declared action's entity handle, absent for locally created actions.
-
value:super::ValueThe value the action resolved to.
-
phase:super::ActionPhaseThe interaction stage, including drag start and release.
Trait Implementations
impl ArchivePointee for ResolvedAction
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ResolvedAction
impl Clone for ResolvedAction
-
fn clone(&self) -> ResolvedActionRelated:
ResolvedAction
impl Copy for ResolvedAction
impl Debug for ResolvedAction
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ResolvedAction
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for ResolvedAction
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ResolvedAction
impl LayoutRaw for ResolvedAction
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ResolvedAction
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ResolvedAction
-
fn eq(&self, other: &ResolvedAction) -> boolRelated:
ResolvedAction
impl Pointee for ResolvedAction
-
type Metadata = ()
impl Read for ResolvedAction
impl StructuralPartialEq for ResolvedAction
impl WithSubscriber for ResolvedAction
ValueMapping
struct ValueMapping {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/input/mod.rs:319-322
The ValueMapping struct binds a trigger value to the transform
used before action evaluation.
From implementations for values use Function::Linear as the default
transform, so callers can pass plain values when no custom mapping is needed.
Implementations
-
fn new<V: Into<Value>>(function: Function, value: V) -> SelfRelated:
FunctionCreates a mapping from a transform function and a compatible input value.
-
fn function(self, function: Function) -> SelfRelated:
FunctionReplaces the transform function used by this mapping.
-
fn value(self, value: Value) -> SelfRelated:
ValueReplaces the input value used by this mapping.
Trait Implementations
impl ArchivePointee for ValueMapping
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ValueMapping
impl Clone for ValueMapping
-
fn clone(&self) -> ValueMappingRelated:
ValueMapping
impl Copy for ValueMapping
impl Debug for ValueMapping
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ValueMapping
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for ValueMapping
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ValueMapping
impl LayoutRaw for ValueMapping
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ValueMapping
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ValueMapping
-
fn eq(&self, other: &ValueMapping) -> boolRelated:
ValueMapping
impl Pointee for ValueMapping
-
type Metadata = ()
impl Read for ValueMapping
impl StructuralPartialEq for ValueMapping
impl WithSubscriber for ValueMapping
ActionEvent
struct ActionEvent {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/input/mod.rs:401-410
The ActionEvent struct carries resolved action input to application code.
Inspector clients can target a named action with a reflected Value
payload. Those posts use the same event channel as physical input.
Implementations
-
fn new(seat_handle: SeatHandle, handle: Handle, value: Value) -> SelfRelated:
SeatHandle,ValueCreates an action event for dispatch through the input event channel.
-
fn is_cancelled(&self) -> boolReports an interaction its sink ended instead of a physical release.
A cancelled drag carries its last position; other actions carry their neutral
value. Check it before committing
an interaction that a release would normally complete, such as a drag.
-
fn phase(&self) -> ActionPhaseRelated:
ActionPhaseReturns the interaction stage. Use it to begin, update, or finish a drag.
-
fn seat_handle(&self) -> SeatHandleRelated:
SeatHandleReturns the seat that produced the action value.
-
fn handle(&self) -> HandleReturns the action handle associated with the event.
-
fn value(&self) -> ValueRelated:
ValueReturns the resolved action value.
Trait Implementations
impl ArchivePointee for ActionEvent
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ActionEvent
impl Clone for ActionEvent
-
fn clone(&self) -> ActionEventRelated:
ActionEvent
impl Debug for ActionEvent
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ActionEvent
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for ActionEvent
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ActionEvent
impl LayoutRaw for ActionEvent
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ActionEvent
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for ActionEvent
-
type Metadata = ()
impl Read for ActionEvent
impl WithSubscriber for ActionEvent
Enums
Capture
enum Capture {
Captured,
Passed,
}Defined in crates/byte-engine/src/input/sink.rs:39-44
The Capture enum reports whether a sink's consumer took an action's input.
Variants
-
CapturedThe consumer handled the action, so its input does not reach later sinks.
-
PassedThe consumer let the action pass, so later sinks still see its input.
Implementations
-
fn when(captured: bool) -> SelfMaps a consumer's decision to a capture. Use it where hit-testing yields a boolean.
Trait Implementations
impl ArchivePointee for Capture
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Capture
impl Clone for Capture
-
fn clone(&self) -> CaptureRelated:
Capture
impl Copy for Capture
impl Debug for Capture
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Capture
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Capture
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for Capture
impl<K> Equivalent for Capture
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for Capture
impl LayoutRaw for Capture
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Capture
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Capture
-
fn eq(&self, other: &Capture) -> boolRelated:
Capture
impl Pointee for Capture
-
type Metadata = ()
impl Read for Capture
impl StructuralPartialEq for Capture
impl WithSubscriber for Capture
Types
enum Types {
Boolean,
Unicode,
Float,
Int,
Vector2,
Vector3,
Quaternion,
Rgba,
}Defined in crates/byte-engine/src/input/mod.rs:66-83
The Types enum identifies the value representation accepted by input
triggers and actions.
Variants
-
BooleanA boolean value.
-
UnicodeA Unicode character.
-
FloatA floating point value.
-
IntAn integer value.
-
Vector2A two-channel input value.
-
Vector3A three-channel input value.
-
QuaternionA quaternion.
-
RgbaAn RGBA color value.
Implementations
-
fn default_value(&self) -> ValueRelated:
ValueReturns the neutral value used before a trigger or action produces input.
Trait Implementations
impl ArchivePointee for Types
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Types
impl Clone for Types
-
fn clone(&self) -> TypesRelated:
Types
impl Copy for Types
impl Debug for Types
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Types
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Types
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for Types
impl<K> Equivalent for Types
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for Types
impl LayoutRaw for Types
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Types
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Types
-
fn eq(&self, other: &Types) -> boolRelated:
Types
impl Pointee for Types
-
type Metadata = ()
impl Read for Types
impl StructuralPartialEq for Types
impl WithSubscriber for Types
Value
enum Value {
Bool(bool),
Unicode(char),
Float(f32),
Int(i32),
Rgba(super::utils::RGBA),
Vector2(Axis2),
Vector3(Axis3),
Quaternion(math::Quaternion),
}Defined in crates/byte-engine/src/input/mod.rs:90-107
The Value enum carries device and action values through the non-generic
input runtime.
Variants
-
BoolA boolean value.
-
UnicodeA Unicode character.
-
FloatA floating point value.
-
IntAn integer value.
-
RgbaAn RGBA color value.
-
Vector2A two-channel input value.
-
Vector3A 3D input value.
-
QuaternionA quaternion.
Implementations
-
fn is_default(&self) -> boolReturns
trueif this value is equal to the default value for its type.Used by
TickPolicy::WhileActiveto determine whether to emit events.
Trait Implementations
impl ArchivePointee for Value
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Value
impl Clone for Value
-
fn clone(&self) -> ValueRelated:
Value
impl Copy for Value
impl Debug for Value
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Value
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Value
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Extract for Value
-
fn extract(&self) -> bool
impl Facet for Value
-
const SHAPE: &'static ::facet::Shape
impl Instrument for Value
impl LayoutRaw for Value
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Value
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Value
-
fn eq(&self, other: &Value) -> boolRelated:
Value
impl Pointee for Value
-
type Metadata = ()
impl Read for Value
impl StructuralPartialEq for Value
impl WithSubscriber for Value
Function
enum Function {
Linear,
Sphere,
}Defined in crates/byte-engine/src/input/mod.rs:256-261
The Function enum identifies how an input value is transformed before it
reaches an action.
Variants
-
LinearPasses the mapped value through without curve-specific remapping.
-
SphereMaps a 2D point to a 3D point on a sphere.
Trait Implementations
impl ArchivePointee for Function
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Function
impl Clone for Function
-
fn clone(&self) -> FunctionRelated:
Function
impl Copy for Function
impl Debug for Function
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Function
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Function
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for Function
impl<K> Equivalent for Function
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for Function
impl LayoutRaw for Function
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Function
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Function
-
fn eq(&self, other: &Function) -> boolRelated:
Function
impl Pointee for Function
-
type Metadata = ()
impl Read for Function
impl StructuralPartialEq for Function
impl WithSubscriber for Function
TickPolicy
enum TickPolicy {
OnChange,
WhileActive,
Always,
}Defined in crates/byte-engine/src/input/mod.rs:268-277
The TickPolicy enum controls how frequently an action emits events through the event channel.
Applications use this policy to choose event-driven or poll-driven handling for each action.
Variants
-
OnChangeEmits events only when a trigger value changes. This is the default.
-
WhileActiveEmits events every frame while the action's resolved value is non-default (e.g. while a key is held, while a stick is displaced from center).
-
AlwaysEmits events every frame, regardless of the action's current value.
Trait Implementations
impl ArchivePointee for TickPolicy
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for TickPolicy
impl Clone for TickPolicy
-
fn clone(&self) -> TickPolicyRelated:
TickPolicy
impl Copy for TickPolicy
impl Debug for TickPolicy
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for TickPolicy
-
fn default() -> TickPolicyRelated:
TickPolicy
impl Downcast for TickPolicy
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for TickPolicy
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for TickPolicy
impl<K> Equivalent for TickPolicy
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for TickPolicy
impl LayoutRaw for TickPolicy
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for TickPolicy
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for TickPolicy
-
fn eq(&self, other: &TickPolicy) -> boolRelated:
TickPolicy
impl Pointee for TickPolicy
-
type Metadata = ()
impl Read for TickPolicy
impl<R> ReadPrimitive for TickPolicy
impl StructuralPartialEq for TickPolicy
impl WithSubscriber for TickPolicy
ActionPhase
enum ActionPhase {
Started,
Updated,
Ended,
Cancelled,
}Defined in crates/byte-engine/src/input/mod.rs:384-394
Identifies the stage of an input interaction.
Variants
-
StartedA drag begins at the current source value.
-
UpdatedA value changes. Ordinary actions and click snapshots also use this phase.
-
EndedA drag finishes on button release, carrying its final source value.
-
CancelledAn interaction is interrupted and must not be committed.
Trait Implementations
impl ArchivePointee for ActionPhase
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ActionPhase
impl Clone for ActionPhase
-
fn clone(&self) -> ActionPhaseRelated:
ActionPhase
impl Copy for ActionPhase
impl Debug for ActionPhase
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for ActionPhase
-
fn default() -> ActionPhaseRelated:
ActionPhase
impl Downcast for ActionPhase
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for ActionPhase
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for ActionPhase
impl<K> Equivalent for ActionPhase
-
fn equivalent(&self, key: &K) -> bool
impl Instrument for ActionPhase
impl LayoutRaw for ActionPhase
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ActionPhase
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ActionPhase
-
fn eq(&self, other: &ActionPhase) -> boolRelated:
ActionPhase
impl Pointee for ActionPhase
-
type Metadata = ()
impl Read for ActionPhase
impl<R> ReadPrimitive for ActionPhase
impl StructuralPartialEq for ActionPhase
impl WithSubscriber for ActionPhase
Traits
Extract<T: InputValue>
trait Extract<T: InputValue> { ... }Defined in crates/byte-engine/src/input/mod.rs:281-284
The Extract trait recovers typed values from the input runtime's
erased Value representation.
Required Methods
-
fn extract(&self) -> TReturns the stored value as the requested input type.