Byte Engine Docs
View on docs.rs

input

Generated Rust API reference for byte_engine.

byte_engine / input


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

ItemKindDescription
Axis2struct
Axis3struct
InputCollectorstruct
SinkHandlestruct
SourceEventstruct
SeatHandlestruct
InputSinkstruct
ResolvedActionstruct
ValueMappingstructThe ValueMapping struct binds a trigger value to the transform used before action evaluation.
ActionEventstructThe ActionEvent struct carries resolved action input to application code.
Captureenum
TypesenumThe [Types] enum identifies the value representation accepted by input triggers and actions.
ValueenumThe [Value] enum carries device and action values through the non-generic input runtime.
FunctionenumThe Function enum identifies how an input value is transformed before it reaches an action.
TickPolicyenumThe TickPolicy enum controls how frequently an action emits events through the event channel.
ActionPhaseenumIdentifies the stage of an input interaction.
ExtracttraitThe 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: f32

    The horizontal input channel.

  • y: f32

    The vertical input channel.

Implementations

  • const fn new(x: f32, y: f32) -> Self

    Creates a two-channel input value from its horizontal and vertical components.

  • const fn zero() -> Self

    Returns the neutral two-channel input value.

  • fn normalized(self) -> Self

    Scales 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) -> Axis2

    Related: Axis2

impl Copy for Axis2
impl Debug for Axis2
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for Axis2
  • fn default() -> Axis2

    Related: 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) -> Axis2

    Related: 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) -> bool

    Related: 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: f32

    The first input channel, conventionally horizontal.

  • y: f32

    The second input channel, conventionally vertical.

  • z: f32

    The third input channel, conventionally depth.

Implementations

  • const fn new(x: f32, y: f32, z: f32) -> Self

    Creates a three-channel input value from its components.

  • const fn zero() -> Self

    Returns the neutral three-channel input value.

  • fn normalized(self) -> Self

    Scales 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) -> Axis3

    Related: Axis3

impl Copy for Axis3
impl Debug for Axis3
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for Axis3
  • fn default() -> Axis3

    Related: 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) -> Axis3

    Related: 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) -> bool

    Related: 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

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) -> SinkHandle

    Related: 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) -> bool

    Related: 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::SeatHandle

    The sender's player seat.

  • device_handle: super::DeviceHandle

    The sender's concrete input device.

  • trigger_handle: super::TriggerHandle

    The sender's registered control.

  • value: super::Value

    The recorded control value.

  • sequence: u64

    The 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
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) -> bool

    Related: 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() -> Self

    Returns 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) -> SeatHandle

    Related: 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) -> bool

    Related: 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

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::ActionHandle

    The 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::Value

    The value the action resolved to.

  • phase: super::ActionPhase

    The 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
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) -> bool

    Related: 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) -> Self

    Related: Function

    Creates a mapping from a transform function and a compatible input value.

  • fn function(self, function: Function) -> Self

    Related: Function

    Replaces the transform function used by this mapping.

  • fn value(self, value: Value) -> Self

    Related: Value

    Replaces 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
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) -> bool

    Related: 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) -> Self

    Related: SeatHandle, Value

    Creates an action event for dispatch through the input event channel.

  • fn is_cancelled(&self) -> bool

    Reports 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) -> ActionPhase

    Related: ActionPhase

    Returns the interaction stage. Use it to begin, update, or finish a drag.

  • fn seat_handle(&self) -> SeatHandle

    Related: SeatHandle

    Returns the seat that produced the action value.

  • fn handle(&self) -> Handle

    Returns the action handle associated with the event.

  • fn value(&self) -> Value

    Related: Value

    Returns 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
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

  • Captured

    The consumer handled the action, so its input does not reach later sinks.

  • Passed

    The consumer let the action pass, so later sinks still see its input.

Implementations

  • fn when(captured: bool) -> Self

    Maps 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) -> Capture

    Related: 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) -> bool

    Related: 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

  • Boolean

    A boolean value.

  • Unicode

    A Unicode character.

  • Float

    A floating point value.

  • Int

    An integer value.

  • Vector2

    A two-channel input value.

  • Vector3

    A three-channel input value.

  • Quaternion

    A quaternion.

  • Rgba

    An RGBA color value.

Implementations

  • fn default_value(&self) -> Value

    Related: Value

    Returns 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) -> Types

    Related: 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) -> bool

    Related: 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

  • Bool

    A boolean value.

  • Unicode

    A Unicode character.

  • Float

    A floating point value.

  • Int

    An integer value.

  • Rgba

    An RGBA color value.

  • Vector2

    A two-channel input value.

  • Vector3

    A 3D input value.

  • Quaternion

    A quaternion.

Implementations

  • fn is_default(&self) -> bool

    Returns true if this value is equal to the default value for its type.

    Used by TickPolicy::WhileActive to 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) -> Value

    Related: 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) -> bool

    Related: 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

  • Linear

    Passes the mapped value through without curve-specific remapping.

  • Sphere

    Maps 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) -> Function

    Related: 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) -> bool

    Related: 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

  • OnChange

    Emits events only when a trigger value changes. This is the default.

  • WhileActive

    Emits 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).

  • Always

    Emits 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) -> TickPolicy

    Related: TickPolicy

impl Copy for TickPolicy
impl Debug for TickPolicy
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for 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) -> bool

    Related: 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

  • Started

    A drag begins at the current source value.

  • Updated

    A value changes. Ordinary actions and click snapshots also use this phase.

  • Ended

    A drag finishes on button release, carrying its final source value.

  • Cancelled

    An 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
impl Copy for ActionPhase
impl Debug for ActionPhase
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for 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) -> bool

    Related: 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) -> T

    Returns the stored value as the requested input type.

Implementors

On this page

Module inputContentsQuick ReferenceStructsAxis2FieldsImplementationsTrait Implementationsimpl Add for Axis2impl ArchivePointee for Axis2impl<ST> CastableFrom for Axis2impl Clone for Axis2impl Copy for Axis2impl Debug for Axis2impl Default for Axis2impl Downcast for Axis2impl DowncastSync for Axis2impl Extract for Valueimpl Instrument for Axis2impl LayoutRaw for Axis2impl<T, N1> Niching for Axis2impl PartialEq for Axis2impl Pointee for Axis2impl Read for Axis2impl<R> ReadPrimitive for Axis2impl StructuralPartialEq for Axis2impl WithSubscriber for Axis2Axis3FieldsImplementationsTrait Implementationsimpl Add for Axis3impl ArchivePointee for Axis3impl<ST> CastableFrom for Axis3impl Clone for Axis3impl Copy for Axis3impl Debug for Axis3impl Default for Axis3impl Downcast for Axis3impl DowncastSync for Axis3impl Extract for Valueimpl Instrument for Axis3impl LayoutRaw for Axis3impl Mul for Axis3impl<T, N1> Niching for Axis3impl PartialEq for Axis3impl Pointee for Axis3impl Read for Axis3impl<R> ReadPrimitive for Axis3impl StructuralPartialEq for Axis3impl WithSubscriber for Axis3InputCollector<A: Allocator + Clone>ImplementationsTrait Implementationsimpl ArchivePointee for InputCollector<A>impl<ST> CastableFrom for InputCollector<A>impl<A: Allocator + Clone + Default> Default for InputCollector<A>impl Downcast for InputCollector<A>impl DowncastSync for InputCollector<A>impl Instrument for InputCollector<A>impl LayoutRaw for InputCollector<A>impl<T, N1> Niching for InputCollector<A>impl Pointee for InputCollector<A>impl Read for InputCollector<A>impl<R> ReadPrimitive for InputCollector<A>impl WithSubscriber for InputCollector<A>SinkHandleTrait Implementationsimpl ArchivePointee for SinkHandleimpl<ST> CastableFrom for SinkHandleimpl Clone for SinkHandleimpl Copy for SinkHandleimpl Debug for SinkHandleimpl Downcast for SinkHandleimpl DowncastSync for SinkHandleimpl Eq for SinkHandleimpl<K> Equivalent for SinkHandleimpl Instrument for SinkHandleimpl LayoutRaw for SinkHandleimpl<T, N1> Niching for SinkHandleimpl PartialEq for SinkHandleimpl Pointee for SinkHandleimpl Read for SinkHandleimpl StructuralPartialEq for SinkHandleimpl WithSubscriber for SinkHandleSourceEventFieldsTrait Implementationsimpl ArchivePointee for SourceEventimpl<ST> CastableFrom for SourceEventimpl Clone for SourceEventimpl Copy for SourceEventimpl Debug for SourceEventimpl Downcast for SourceEventimpl DowncastSync for SourceEventimpl Facet for SourceEventimpl Instrument for SourceEventimpl LayoutRaw for SourceEventimpl<T, N1> Niching for SourceEventimpl PartialEq for SourceEventimpl Pointee for SourceEventimpl Read for SourceEventimpl StructuralPartialEq for SourceEventimpl WithSubscriber for SourceEventSeatHandleImplementationsTrait Implementationsimpl ArchivePointee for SeatHandleimpl<ST> CastableFrom for SeatHandleimpl Clone for SeatHandleimpl Copy for SeatHandleimpl Debug for SeatHandleimpl Downcast for SeatHandleimpl DowncastSync for SeatHandleimpl Eq for SeatHandleimpl<K> Equivalent for SeatHandleimpl Facet for SeatHandleimpl Hash for SeatHandleimpl Instrument for SeatHandleimpl LayoutRaw for SeatHandleimpl<T, N1> Niching for SeatHandleimpl PartialEq for SeatHandleimpl Pointee for SeatHandleimpl Read for SeatHandleimpl StructuralPartialEq for SeatHandleimpl WithSubscriber for SeatHandleInputSink<A: Allocator + Clone>ImplementationsTrait Implementationsimpl ArchivePointee for InputSink<A>impl<ST> CastableFrom for InputSink<A>impl Downcast for InputSink<A>impl DowncastSync for InputSink<A>impl Instrument for InputSink<A>impl LayoutRaw for InputSink<A>impl<T, N1> Niching for InputSink<A>impl Pointee for InputSink<A>impl Read for InputSink<A>impl WithSubscriber for InputSink<A>ResolvedActionFieldsTrait Implementationsimpl ArchivePointee for ResolvedActionimpl<ST> CastableFrom for ResolvedActionimpl Clone for ResolvedActionimpl Copy for ResolvedActionimpl Debug for ResolvedActionimpl Downcast for ResolvedActionimpl DowncastSync for ResolvedActionimpl Instrument for ResolvedActionimpl LayoutRaw for ResolvedActionimpl<T, N1> Niching for ResolvedActionimpl PartialEq for ResolvedActionimpl Pointee for ResolvedActionimpl Read for ResolvedActionimpl StructuralPartialEq for ResolvedActionimpl WithSubscriber for ResolvedActionValueMappingImplementationsTrait Implementationsimpl ArchivePointee for ValueMappingimpl<ST> CastableFrom for ValueMappingimpl Clone for ValueMappingimpl Copy for ValueMappingimpl Debug for ValueMappingimpl Downcast for ValueMappingimpl DowncastSync for ValueMappingimpl Instrument for ValueMappingimpl LayoutRaw for ValueMappingimpl<T, N1> Niching for ValueMappingimpl PartialEq for ValueMappingimpl Pointee for ValueMappingimpl Read for ValueMappingimpl StructuralPartialEq for ValueMappingimpl WithSubscriber for ValueMappingActionEventImplementationsTrait Implementationsimpl ArchivePointee for ActionEventimpl<ST> CastableFrom for ActionEventimpl Clone for ActionEventimpl Debug for ActionEventimpl Downcast for ActionEventimpl DowncastSync for ActionEventimpl Instrument for ActionEventimpl LayoutRaw for ActionEventimpl<T, N1> Niching for ActionEventimpl Pointee for ActionEventimpl Read for ActionEventimpl WithSubscriber for ActionEventEnumsCaptureVariantsImplementationsTrait Implementationsimpl ArchivePointee for Captureimpl<ST> CastableFrom for Captureimpl Clone for Captureimpl Copy for Captureimpl Debug for Captureimpl Downcast for Captureimpl DowncastSync for Captureimpl Eq for Captureimpl<K> Equivalent for Captureimpl Instrument for Captureimpl LayoutRaw for Captureimpl<T, N1> Niching for Captureimpl PartialEq for Captureimpl Pointee for Captureimpl Read for Captureimpl StructuralPartialEq for Captureimpl WithSubscriber for CaptureTypesVariantsImplementationsTrait Implementationsimpl ArchivePointee for Typesimpl<ST> CastableFrom for Typesimpl Clone for Typesimpl Copy for Typesimpl Debug for Typesimpl Downcast for Typesimpl DowncastSync for Typesimpl Eq for Typesimpl<K> Equivalent for Typesimpl Instrument for Typesimpl LayoutRaw for Typesimpl<T, N1> Niching for Typesimpl PartialEq for Typesimpl Pointee for Typesimpl Read for Typesimpl StructuralPartialEq for Typesimpl WithSubscriber for TypesValueVariantsImplementationsTrait Implementationsimpl ArchivePointee for Valueimpl<ST> CastableFrom for Valueimpl Clone for Valueimpl Copy for Valueimpl Debug for Valueimpl Downcast for Valueimpl DowncastSync for Valueimpl Extract for Valueimpl Facet for Valueimpl Instrument for Valueimpl LayoutRaw for Valueimpl<T, N1> Niching for Valueimpl PartialEq for Valueimpl Pointee for Valueimpl Read for Valueimpl StructuralPartialEq for Valueimpl WithSubscriber for ValueFunctionVariantsTrait Implementationsimpl ArchivePointee for Functionimpl<ST> CastableFrom for Functionimpl Clone for Functionimpl Copy for Functionimpl Debug for Functionimpl Downcast for Functionimpl DowncastSync for Functionimpl Eq for Functionimpl<K> Equivalent for Functionimpl Instrument for Functionimpl LayoutRaw for Functionimpl<T, N1> Niching for Functionimpl PartialEq for Functionimpl Pointee for Functionimpl Read for Functionimpl StructuralPartialEq for Functionimpl WithSubscriber for FunctionTickPolicyVariantsTrait Implementationsimpl ArchivePointee for TickPolicyimpl<ST> CastableFrom for TickPolicyimpl Clone for TickPolicyimpl Copy for TickPolicyimpl Debug for TickPolicyimpl Default for TickPolicyimpl Downcast for TickPolicyimpl DowncastSync for TickPolicyimpl Eq for TickPolicyimpl<K> Equivalent for TickPolicyimpl Instrument for TickPolicyimpl LayoutRaw for TickPolicyimpl<T, N1> Niching for TickPolicyimpl PartialEq for TickPolicyimpl Pointee for TickPolicyimpl Read for TickPolicyimpl<R> ReadPrimitive for TickPolicyimpl StructuralPartialEq for TickPolicyimpl WithSubscriber for TickPolicyActionPhaseVariantsTrait Implementationsimpl ArchivePointee for ActionPhaseimpl<ST> CastableFrom for ActionPhaseimpl Clone for ActionPhaseimpl Copy for ActionPhaseimpl Debug for ActionPhaseimpl Default for ActionPhaseimpl Downcast for ActionPhaseimpl DowncastSync for ActionPhaseimpl Eq for ActionPhaseimpl<K> Equivalent for ActionPhaseimpl Instrument for ActionPhaseimpl LayoutRaw for ActionPhaseimpl<T, N1> Niching for ActionPhaseimpl PartialEq for ActionPhaseimpl Pointee for ActionPhaseimpl Read for ActionPhaseimpl<R> ReadPrimitive for ActionPhaseimpl StructuralPartialEq for ActionPhaseimpl WithSubscriber for ActionPhaseTraitsExtract<T: InputValue>Required MethodsImplementors