Byte Engine Docs
View on docs.rs

application

Generated Rust API reference for byte_engine.

byte_engine / application


Module application

Application lifecycle and composition.

Use BaseApplication when building a custom runtime that only needs parameter handling and frame-local storage. Headed applications should start with GraphicsApplication and choose either default_setup or individual graphics setup functions.

The triangle example demonstrates the standard setup path, while the window example demonstrates selecting only one setup component.

Contents

Quick Reference

ItemKindDescription
applicationmodCore application contract and the minimal implementation used by higher-level runtimes.
threadmodWorker-thread support for application-owned subsystems.
graphicsmodHeaded application runtime and graphics setup entry points.
BaseApplicationstruct
TimestructThe [Time] struct provides frame timing to application systems without exposing the lifecycle clock owned by the application.
ParameterstructThe [Parameter] struct represents one application configuration value from code, the environment, or command-line arguments.
EventsenumThe [Events] enum defines messages shared with application-owned worker threads.
Applicationtrait

Modules

  • application — Core application contract and the minimal implementation used by higher-level runtimes.
  • thread — Worker-thread support for application-owned subsystems.
  • graphics — Headed application runtime and graphics setup entry points.

Structs

BaseApplication

struct BaseApplication {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/application/application.rs:35-39

The BaseApplication struct provides shared process configuration and frame-local storage for application implementations.

Embed it in a specialized application rather than using it as a complete game loop. GraphicsApplication uses the established headed composition pattern.

Trait Implementations

impl Application for BaseApplication
  • fn new(name: &str, parameters: &[Parameter]) -> BaseApplication

    Related: Parameter, BaseApplication

  • fn tick(&mut self) -> bool
  • fn get_name(&self) -> &str
impl ArchivePointee for BaseApplication
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for BaseApplication
impl Downcast for BaseApplication
  • 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 DowncastSend for BaseApplication
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl Instrument for BaseApplication
impl LayoutRaw for BaseApplication
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for BaseApplication
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for BaseApplication
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for BaseApplication
  • type Metadata = ()
impl Read for BaseApplication
impl WithSubscriber for BaseApplication

Time

struct Time {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/application/mod.rs:29-32

The Time struct provides frame timing to application systems without exposing the lifecycle clock owned by the application.

Implementations

  • fn new(elapsed: MediaTime, delta: MediaTime) -> Self

    Related: MediaTime

    Creates frame timing data for systems that run inside an application tick.

  • fn elapsed(&self) -> MediaTime

    Related: MediaTime

    Returns the total time since the application started.

  • fn delta(&self) -> MediaTime

    Related: MediaTime

    Returns the time since the previous application tick.

Trait Implementations

impl ArchivePointee for Time
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Time
impl Clone for Time
  • fn clone(&self) -> Time

    Related: Time

impl Copy for Time
impl Debug for Time
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Time
  • 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 DowncastSend for Time
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for Time
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Instrument for Time
impl LayoutRaw for Time
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Time
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for Time
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for Time
  • type Metadata = ()
impl Read for Time
impl WithSubscriber for Time

Parameter

struct Parameter {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/application/mod.rs:54-57

The Parameter struct represents one application configuration value from code, the environment, or command-line arguments.

Implementations

  • fn new(name: &str, value: &str) -> Self

    Creates a parameter from borrowed name and value strings.

  • fn new_string(name: String, value: String) -> Self

    Creates a parameter from owned name and value strings.

  • fn is(&self, name: &str) -> bool

    Returns whether this parameter has the requested name.

  • fn as_bool(&self) -> Option<bool>

    Parses the parameter's value as a bool.

    Returns Some(true) for true, TRUE, or 1. Returns Some(false) for

    false, FALSE, or 0. Returns None for all other values.

  • fn as_bool_simple(&self) -> bool

    Parses the parameter as a Boolean value and returns false if parsing fails.

    Use Self::as_bool when the caller must distinguish false from an

    invalid value.

  • fn name(&self) -> &str

    Returns the parameter name used by application configuration lookup.

  • fn value(&self) -> &str

    Returns the raw parameter value before caller-specific parsing.

Trait Implementations

impl ArchivePointee for Parameter
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Parameter
impl Clone for Parameter
  • fn clone(&self) -> Parameter

    Related: Parameter

impl Debug for Parameter
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Parameter
  • 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 DowncastSend for Parameter
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for Parameter
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for Parameter
impl<K> Equivalent for Parameter
  • fn equivalent(&self, key: &K) -> bool
impl Hash for Parameter
  • fn hash<__H: hash::Hasher>(&self, state: &mut __H)
impl Instrument for Parameter
impl LayoutRaw for Parameter
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Parameter
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Parameter
  • fn eq(&self, other: &Parameter) -> bool

    Related: Parameter

impl Pointable for Parameter
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for Parameter
  • type Metadata = ()
impl Read for Parameter
impl StructuralPartialEq for Parameter
impl WithSubscriber for Parameter

Enums

Events

enum Events {
    Close,
}

Defined in crates/byte-engine/src/application/mod.rs:111-114

The Events enum defines messages shared with application-owned worker threads.

Variants

  • Close

    Requests that the application close.

Trait Implementations

impl ArchivePointee for Events
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Events
impl Clone for Events
  • fn clone(&self) -> Events

    Related: Events

impl Copy for Events
impl Debug for Events
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Events
  • 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 DowncastSend for Events
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for Events
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for Events
impl<K> Equivalent for Events
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for Events
impl LayoutRaw for Events
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Events
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Events
  • fn eq(&self, other: &Events) -> bool

    Related: Events

impl Pointable for Events
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for Events
  • type Metadata = ()
impl Read for Events
impl StructuralPartialEq for Events
impl WithSubscriber for Events

Traits

Application

trait Application { ... }

Defined in crates/byte-engine/src/application/application.rs:19-28

The Application trait defines the lifecycle contract for a process-level Byte-Engine runtime.

Applications are intended to be singletons that own engine-wide state. Most headed programs should use GraphicsApplication instead of implementing this trait directly.

Parameters passed to Application::new may be overridden by BE_* environment variables and then by --name=value command-line arguments.

Required Methods

  • fn new(name: &str, parameters: &[Parameter]) -> Self

    Creates an application with the specified name and configuration parameters.

  • fn get_name(&self) -> &str

    Returns the name of the application.

  • fn tick(&mut self) -> bool

    Advances the application by one tick.

Implementors

On this page

Module applicationContentsQuick ReferenceModulesStructsBaseApplicationTrait Implementationsimpl Application for BaseApplicationimpl ArchivePointee for BaseApplicationimpl<ST> CastableFrom for BaseApplicationimpl Downcast for BaseApplicationimpl DowncastSend for BaseApplicationimpl Instrument for BaseApplicationimpl LayoutRaw for BaseApplicationimpl<T, N1> Niching for BaseApplicationimpl Pointable for BaseApplicationimpl Pointee for BaseApplicationimpl Read for BaseApplicationimpl WithSubscriber for BaseApplicationTimeImplementationsTrait Implementationsimpl ArchivePointee for Timeimpl<ST> CastableFrom for Timeimpl Clone for Timeimpl Copy for Timeimpl Debug for Timeimpl Downcast for Timeimpl DowncastSend for Timeimpl DowncastSync for Timeimpl Instrument for Timeimpl LayoutRaw for Timeimpl<T, N1> Niching for Timeimpl Pointable for Timeimpl Pointee for Timeimpl Read for Timeimpl WithSubscriber for TimeParameterImplementationsTrait Implementationsimpl ArchivePointee for Parameterimpl<ST> CastableFrom for Parameterimpl Clone for Parameterimpl Debug for Parameterimpl Downcast for Parameterimpl DowncastSend for Parameterimpl DowncastSync for Parameterimpl Eq for Parameterimpl<K> Equivalent for Parameterimpl Hash for Parameterimpl Instrument for Parameterimpl LayoutRaw for Parameterimpl<T, N1> Niching for Parameterimpl PartialEq for Parameterimpl Pointable for Parameterimpl Pointee for Parameterimpl Read for Parameterimpl StructuralPartialEq for Parameterimpl WithSubscriber for ParameterEnumsEventsVariantsTrait Implementationsimpl ArchivePointee for Eventsimpl<ST> CastableFrom for Eventsimpl Clone for Eventsimpl Copy for Eventsimpl Debug for Eventsimpl Downcast for Eventsimpl DowncastSend for Eventsimpl DowncastSync for Eventsimpl Eq for Eventsimpl<K> Equivalent for Eventsimpl Instrument for Eventsimpl LayoutRaw for Eventsimpl<T, N1> Niching for Eventsimpl PartialEq for Eventsimpl Pointable for Eventsimpl Pointee for Eventsimpl Read for Eventsimpl StructuralPartialEq for Eventsimpl WithSubscriber for EventsTraitsApplicationRequired MethodsImplementors