byte_engine
Generated Rust API reference for byte_engine.
Crate byte_engine
Byte-Engine is a composable Rust game engine for applications that need graphics, input, audio, physics, and retained UI in one runtime.
Headed applications usually start with GraphicsApplication and default_setup.
Lower-level users can compose application::BaseApplication, factories,
channels, render passes, and UI layout pieces directly.
use byte_engine::application::Parameter;
use byte_engine::application::graphics::{default_setup, GraphicsApplication};
let mut application = GraphicsApplication::new("example", &[] as &[Parameter]);
default_setup(&mut application);Start with the getting started guide for installation, project setup, and the first application workflow.
Contents
Quick Reference
| Item | Kind | Description |
|---|---|---|
utils | mod | The utils module provides engine utility types through the main byte_engine crate API. |
animation | mod | Flipbook playback, skeletal animation sampling, and pose blending. |
application | mod | Application lifecycle and composition. |
audio | mod | Audio playback and procedural synthesis. |
configuration | mod | Asynchronous configuration messages used by debugging adapters and engine systems. |
core | mod | Shared ownership, messaging, factories, and lane primitives. |
input | mod | Device-independent input actions, collected once and pulled by layered sinks. |
ui | mod | Retained UI components, layout evaluation, styling, and rendering. |
constants | mod | Common directions in the engine's default coordinate system. |
gameplay | mod | World-level gameplay objects and transform coordination. |
network | mod | BETP client/server integration and replication contracts. |
physics | mod | Physics contracts and the built-in Dynabit simulation. |
rendering | mod | Rendering orchestration, scene pipelines, and composable post-processing. |
space | mod | Small spatial capability traits shared by gameplay, physics, and rendering. |
time | mod | Fixed-rate time used by engine simulation and media timelines. |
inspector | mod | Runtime inspection contracts and protocol-facing state access. |
metrics | mod | Per-tick performance samples for tooling that reads them over the inspector. |
MediaTime | struct | |
and! | macro | Awaits related activities in written order, discarding their results. |
perform! | macro | Repeats async branches, checking their waits in written order. |
Modules
utils— Theutilsmodule provides engine utility types through the mainbyte_enginecrate API.animation— Flipbook playback, skeletal animation sampling, and pose blending.application— Application lifecycle and composition.audio— Audio playback and procedural synthesis.configuration— Asynchronous configuration messages used by debugging adapters and engine systems.core— Shared ownership, messaging, factories, and lane primitives.input— Device-independent input actions, collected once and pulled by layered sinks.ui— Retained UI components, layout evaluation, styling, and rendering.constants— Common directions in the engine's default coordinate system.gameplay— World-level gameplay objects and transform coordination.network— BETP client/server integration and replication contracts.physics— Physics contracts and the built-in Dynabit simulation.rendering— Rendering orchestration, scene pipelines, and composable post-processing.space— Small spatial capability traits shared by gameplay, physics, and rendering.time— Fixed-rate time used by engine simulation and media timelines.inspector— Runtime inspection contracts and protocol-facing state access.metrics— Per-tick performance samples for tooling that reads them over the inspector.
Structs
MediaTime
struct MediaTime();Defined in crates/byte-engine/src/time.rs:20
The MediaTime struct provides a shared, allocation-free time unit for
simulation, animation, and media synchronization.
Implementations
-
const ZERO: Self -
const MIN: Self -
const MAX: Self -
const TICKS_PER_SECOND: i64 -
const fn from_ticks(ticks: i64) -> SelfCreates a time value from raw engine ticks.
-
const fn as_ticks(self) -> i64Returns the raw engine tick count.
-
fn from_seconds(seconds: i64) -> SelfCreates a time value from a whole number of seconds.
-
fn from_seconds_f64(seconds: f64) -> SelfCreates a time value from fractional seconds, rounded to the nearest tick.
-
fn from_seconds_f32(seconds: f32) -> SelfCreates a time value from fractional seconds, rounded to the nearest tick.
-
fn from_millis(milliseconds: i64) -> SelfCreates a time value from milliseconds.
-
fn from_micros(microseconds: i64) -> SelfCreates a time value from microseconds, rounded to the nearest tick.
-
fn from_frames(frame_count: i64, frames_per_second: u32) -> Option<Self>Creates the duration occupied by an exact number of frames.
Returns
Nonewhen the frame rate does not divide the engine timebase orwhen the resulting tick count would overflow.
-
fn from_samples(sample_count: i64, samples_per_second: u32) -> Option<Self>Creates the duration occupied by an exact number of audio samples.
Returns
Nonewhen the sample rate does not divide the engine timebase orwhen the resulting tick count would overflow.
-
fn from_std(duration: Duration) -> SelfConverts a standard duration into engine time, rounded to the nearest tick.
-
fn to_std(self) -> DurationConverts a non-negative engine time into a standard duration.
-
fn as_seconds_f64(self) -> f64Returns this time value as fractional seconds.
-
fn as_seconds_f32(self) -> f32Returns this time value as fractional seconds.
-
const fn checked_add(self, rhs: Self) -> Option<Self>Returns the sum, or
Nonewhen it falls outside the timeline range. -
const fn checked_sub(self, rhs: Self) -> Option<Self>Returns the difference, or
Nonewhen it falls outside the timeline range. -
const fn saturating_sub(self, rhs: Self) -> SelfReturns the difference clamped to the timeline range.
Trait Implementations
impl Add for MediaTime
-
type Output = MediaTime -
fn add(self, rhs: Self) -> <Self as >::Output
impl AddAssign for MediaTime
-
fn add_assign(&mut self, rhs: Self)
impl ArchivePointee for MediaTime
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MediaTime
impl Clone for MediaTime
-
fn clone(&self) -> MediaTimeRelated:
MediaTime
impl<K> Comparable for MediaTime
-
fn compare(&self, key: &K) -> Ordering
impl Copy for MediaTime
impl Debug for MediaTime
-
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
impl Default for MediaTime
-
fn default() -> MediaTimeRelated:
MediaTime
impl Div for MediaTime
-
type Output = MediaTime -
fn div(self, rhs: i64) -> <Self as >::Output
impl Downcast for MediaTime
-
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 MediaTime
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for MediaTime
impl<K> Equivalent for MediaTime
-
fn equivalent(&self, key: &K) -> bool
impl Hash for MediaTime
-
fn hash<__H: hash::Hasher>(&self, state: &mut __H)
impl Instrument for MediaTime
impl LayoutRaw for MediaTime
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl Mul for MediaTime
-
type Output = MediaTime -
fn mul(self, rhs: i64) -> <Self as >::Output
impl Neg for MediaTime
-
type Output = MediaTime -
fn neg(self) -> <Self as >::Output
impl<T, N1> Niching for MediaTime
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Ord for MediaTime
-
fn cmp(&self, other: &MediaTime) -> cmp::OrderingRelated:
MediaTime
impl PartialEq for MediaTime
-
fn eq(&self, other: &MediaTime) -> boolRelated:
MediaTime
impl PartialOrd for MediaTime
-
fn partial_cmp(&self, other: &MediaTime) -> option::Option<cmp::Ordering>Related:
MediaTime
impl Pointee for MediaTime
-
type Metadata = ()
impl Read for MediaTime
impl<R> ReadPrimitive for MediaTime
impl StructuralPartialEq for MediaTime
impl Sub for MediaTime
-
type Output = MediaTime -
fn sub(self, rhs: Self) -> <Self as >::Output
impl SubAssign for MediaTime
-
fn sub_assign(&mut self, rhs: Self)
impl WithSubscriber for MediaTime
Macros
and!
Defined in crates/byte-engine/src/gameplay/tasks.rs:81-102
Awaits related activities in written order, discarding their results.
Use this inside a perform! branch for activities that belong to the same update. Each expression is
created only after the previous one finishes, so successive calls can borrow the same mutable state.
If an activity suspends, the group suspends there; later activities start when it finishes.
Write when future => { activities } to run activities only if the event is ready at that point. The event is
polled once in the current task's context, then dropped. A pending event skips its activities without suspending
the group. Event futures must tolerate cancellation; keep their underlying listener or state between updates.
The body uses the same awaited activity syntax, and can suspend once selected, just like an ordinary activity.
perform!
Defined in crates/byte-engine/src/gameplay/tasks.rs:119-164
Repeats async branches, checking their waits in written order.
Write when future => { actions } to handle an event, or each value = future => { actions } to handle
repeated updates and use their results. Wait expressions are rebuilt for each selection and fused automatically.
The first ready wait chooses the branch, whose actions run to completion before another branch is chosen. An
await inside those actions can suspend the entire performance. Use break to end it or return to end the
enclosing task.
Add always { actions } for a shared step before each selection, including the first. It runs again after a
selected branch finishes, and may await while borrowing the same state as the branches. It does not run in
parallel with a branch or while a nested performance is active. break and return leave immediately.
Nest a performance inside a branch to replace the outer activities until that inner performance ends.
The original select_biased! branch syntax is also accepted; fuse those futures yourself.