pub struct Session<A: Stores> {
pub app: A,
/* private fields */
}Expand description
A CPU value with no GPU or window object; Send, and it builds for wasm32.
Fields§
§app: AImplementations§
Source§impl<A: Stores> Session<A>
impl<A: Stores> Session<A>
pub fn new(app: A, config: SimConfig) -> Self
pub fn config(&self) -> SimConfig
pub fn scene(&self) -> SceneId
pub fn current_tick(&self) -> Tick
pub fn faulted_phase(&self) -> Option<Phase>
pub fn phase_error(&self) -> Option<PhaseError>
pub fn register_domain<S: DomainSpace>( &mut self, builder: DomainBuilder<S>, ) -> DomainHandle<S>
pub fn domains(&self) -> &Domains
pub fn domains_mut(&mut self) -> &mut Domains
pub fn views(&self) -> &Views
pub fn views_mut(&mut self) -> &mut Views
pub fn entities(&self) -> &Entities
pub fn submit(&mut self, command: Command<A>) -> RequestId
pub fn prepare(&mut self, geometry: PreparedGeometry) -> PreparedId
pub fn prepared(&self, id: PreparedId) -> Option<&PreparedGeometry>
Sourcepub fn add_palette(&mut self, colors: Vec<[f32; 4]>) -> PaletteId
pub fn add_palette(&mut self, colors: Vec<[f32; 4]>) -> PaletteId
Two colors per prepared segment, start then end, read in the prepared geometry’s own order; a segment past the palette’s end keeps the material color.
pub fn palette(&self, id: PaletteId) -> Option<&[[f32; 4]]>
pub fn add_material(&mut self, material: Material) -> MaterialId
pub fn material(&self, id: MaterialId) -> Option<&Material>
pub fn system( &mut self, phase: Phase, name: &'static str, system: impl System<A>, )
Sourcepub fn system_at(
&mut self,
phase: Phase,
order: Order,
name: &'static str,
system: impl System<A>,
) -> Option<()>
pub fn system_at( &mut self, phase: Phase, order: Order, name: &'static str, system: impl System<A>, ) -> Option<()>
None when no entry of that phase has the named anchor.
pub fn entries(&self, phase: Phase) -> &[SystemEntry<A>]
pub fn dispatch<R>(&mut self, f: impl FnOnce(&mut Dispatch<'_, A>) -> R) -> R
pub fn bridges(&self) -> &Relation<Bridge>
pub fn bridge(&mut self, spec: BridgeSpec) -> Result<LinkId, BridgeError>
pub fn dragging(&self) -> Option<Drag>
pub fn grab(&mut self, ndc: [f32; 2], time: f64) -> Result<Pick, DragError>
pub fn drag( &mut self, ndc: [f32; 2], time: f64, ) -> Result<ChartPoint, DragError>
pub fn release(&mut self) -> Option<DragRelease>
pub fn release_at(&mut self, time: f64) -> Option<DragRelease>
pub fn cancel_drag(&mut self) -> Option<DragRelease>
pub fn boundary(&mut self, input: Input) -> Result<Growth, PhaseError>
pub fn tick(&mut self) -> Result<(), PhaseError>
pub fn publish(&mut self, into: &mut Publication) -> Result<(), PhaseError>
Sourcepub fn publish_at(
&mut self,
into: &mut Publication,
alpha: f32,
) -> Result<(), PhaseError>
pub fn publish_at( &mut self, into: &mut Publication, alpha: f32, ) -> Result<(), PhaseError>
Draws each pose alpha of the way from where it stood before the last tick to where it stands now, with alpha clamped to [0, 1] and NaN taken as 1.
Sourcepub fn take_input(&mut self) -> Input
pub fn take_input(&mut self) -> Input
Call after the frame’s last tick; systems see an empty input until the next boundary.
pub fn results(&self) -> &[CommandResult]
pub fn pick(&self, ndc: [f32; 2]) -> Option<Pick>
Sourcepub fn snapshot(&self) -> Result<SessionSnapshot<A>, RestoreError>
pub fn snapshot(&self) -> Result<SessionSnapshot<A>, RestoreError>
Unfinished while a phase is incomplete and Pending while deferred mutation remains.
Sourcepub fn restore(&mut self, from: &SessionSnapshot<A>) -> Result<(), RestoreError>
pub fn restore(&mut self, from: &SessionSnapshot<A>) -> Result<(), RestoreError>
Validates ownership and every domain before it cancels pending commands and advances the epoch; a failure after that faults the session until a later restore succeeds.