pub struct Headless<G: GameData> { /* private fields */ }Implementations§
Source§impl<G: GameData> Headless<G>
impl<G: GameData> Headless<G>
Sourcepub fn new(harness: Harness<G>) -> Self
pub fn new(harness: Harness<G>) -> Self
A session of harness, with no scene and no events of the game’s.
Sourcepub fn with_scene(
self,
scene: impl Fn(&Harness<G>) -> Result<Scene, String> + 'static,
) -> Self
pub fn with_scene( self, scene: impl Fn(&Harness<G>) -> Result<Scene, String> + 'static, ) -> Self
This session, its scene from scene.
Sourcepub fn with_events(
self,
events: impl Fn(&Harness<G>) -> Vec<String> + 'static,
) -> Self
pub fn with_events( self, events: impl Fn(&Harness<G>) -> Vec<String> + 'static, ) -> Self
This session, the game’s events from events.
Trait Implementations§
Source§impl<G: GameData> Session for Headless<G>
impl<G: GameData> Session for Headless<G>
Source§fn set_perf(&mut self, on: bool)
fn set_perf(&mut self, on: bool)
Gives the Harness this machine’s clock, and in a build that counts
the heap this program’s heap counter and its memory tags (and tags
the asset decodes), each unless its platform has one already (a
test’s fake, kept so its records stay the same); false takes away
what it gave. Before the game has loaded it does nothing.
Source§fn actions(&self) -> Vec<String>
fn actions(&self) -> Vec<String>
The game’s actions that have a key or a button now, in its action
set’s order: those a script’s
act step can press (none by
default).Source§fn play_record(&mut self) -> Option<Played>
fn play_record(&mut self) -> Option<Played>
Plays the session record it was made ready for
(
GameTools::session_from) to
its end, or its first frame that plays differently, and says how far
it has got. Asked again, it plays nothing more: its limits then say
what a script’s frames took over from it. None for a session
started from options, the default.Source§fn frame_count(&self) -> u32
fn frame_count(&self) -> u32
How many frames have run.
Source§fn quit_frame(&self) -> Option<u32>
fn quit_frame(&self) -> Option<u32>
The frame the game asked to quit in, if it has.
Source§fn events(&self) -> Vec<Event>
fn events(&self) -> Vec<Event>
What happened, in frame order: screens opening and closing, music,
voices, the quit, then the game’s own events.
Source§fn sounds_added(&self) -> Vec<AddedSound>
fn sounds_added(&self) -> Vec<AddedSound>
The sounds the game added at run time and hasn’t removed, in cue
order (none by default).
Source§fn log(&self) -> Vec<LogEntry>
fn log(&self) -> Vec<LogEntry>
The game’s log, oldest first: its last lines (none by default).
Source§fn log_dropped(&self) -> u32
fn log_dropped(&self) -> u32
How many older lines the log dropped (0 by default).
Source§fn modules(&self) -> Vec<ModuleEntry>
fn modules(&self) -> Vec<ModuleEntry>
The modules installed in the game, in install order (none by
default).
Source§fn counts_process_heap(&self) -> bool
fn counts_process_heap(&self) -> bool
Whether its records’ heap counts are this tool program’s own heap
counter’s, which counts the whole program (every thread’s
allocations), not a fake’s. By default not.
Source§fn perf(&self, since: u64, max: u32) -> PerfRead
fn perf(&self, since: u64, max: u32) -> PerfRead
The frames’ records kept, numbered
since or more, the first max
of them (PerfRead). By default nothing, measured.Source§fn heap_snapshot(&mut self) -> Option<HeapSnapshot>
fn heap_snapshot(&mut self) -> Option<HeapSnapshot>
What holds the heap now, by memory tag, at the frames run: a fake
memory’s, or with perf on (
set_perf) this
program’s heap counter’s, in a build that counts it. By default
none.Auto Trait Implementations§
impl<G> !RefUnwindSafe for Headless<G>
impl<G> !Send for Headless<G>
impl<G> !Sync for Headless<G>
impl<G> !UnwindSafe for Headless<G>
impl<G> Freeze for Headless<G>
impl<G> Unpin for Headless<G>
impl<G> UnsafeUnpin for Headless<G>
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
Mutably borrows from an owned value. Read more