pub struct InputPacket {
pub raw: RenderInput,
pub cursor_outside_window: bool,
pub viewport: (f32, f32),
}Expand description
One frame’s sampled window input, taken beside the backend right after the draw (whose event pump produced it) and consumed by the input system. In serial execution it is deposited and consumed within the same tick; the pipelined driver ships it across the thread boundary instead.
Fields§
§raw: RenderInputThe raw sampled input state.
cursor_outside_window: boolWhether the cursor has left the window.
viewport: (f32, f32)Logical window size, for UI hit-testing and overlay layout.
Implementations§
Source§impl InputPacket
impl InputPacket
Sourcepub fn sample(backend: &mut dyn RenderBackend) -> InputPacket
pub fn sample(backend: &mut dyn RenderBackend) -> InputPacket
Sample the backend’s accumulated input, cursor containment, and logical size into one packet. Called right after the draw so the frame’s event pump is reflected.
Sourcepub fn merge_from(&mut self, newer: InputPacket)
pub fn merge_from(&mut self, newer: InputPacket)
Fold a newer packet onto this one without losing edges: one-frame pulses OR together, deltas accumulate, positions and held states take the newer value. Only needed when a consumer misses a frame (startup, a stall); steady state is one packet per tick.
Trait Implementations§
Source§impl Clone for InputPacket
impl Clone for InputPacket
Source§fn clone(&self) -> InputPacket
fn clone(&self) -> InputPacket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InputPacket
Source§impl Debug for InputPacket
impl Debug for InputPacket
Source§impl Default for InputPacket
impl Default for InputPacket
Source§fn default() -> InputPacket
fn default() -> InputPacket
Auto Trait Implementations§
impl Freeze for InputPacket
impl RefUnwindSafe for InputPacket
impl Send for InputPacket
impl Sync for InputPacket
impl Unpin for InputPacket
impl UnsafeUnpin for InputPacket
impl UnwindSafe for InputPacket
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().