pub struct CompletedStep<'owner> { /* private fields */ }Expand description
The event families produced by one world step that reached native simulation.
This capability owns a real exclusive borrow of the ordinary world or recording session which stepped it. It exposes no mutable world access, so Box2D’s transient event buffers remain valid until the capability ends. Dropping the value retires that state immediately; forgetting it is still harmless because the next owner operation retires it explicitly.
Self::post_step_error reports a callback, task, or recording-writer failure discovered
after Box2D advanced. An outer error from World::step or RecordingSession::step therefore
always means native simulation was not called.
Implementations§
Source§impl<'owner> CompletedStep<'owner>
impl<'owner> CompletedStep<'owner>
Sourcepub const fn post_step_error(&self) -> Option<Error>
pub const fn post_step_error(&self) -> Option<Error>
Returns a failure discovered after native simulation advanced.
Event families remain available for ordinary worlds. A recording-writer failure is sticky, so event materialization through that recording session also returns the writer error.
Sourcepub fn into_result(self) -> Result<Self>
pub fn into_result(self) -> Result<Self>
Restores the traditional result-first projection.
On error this drops the completed-step capability and retires its transient outputs. Use
Self::post_step_error when the caller must still publish events or synchronize state
after native advancement.
Sourcepub fn body_events(&self) -> Result<BodyEvents<'_>>
pub fn body_events(&self) -> Result<BodyEvents<'_>>
Borrow mapped body-move events, fetching this native family at most once.
Sourcepub fn contact_events(&self) -> Result<ContactEventsView<'_>>
pub fn contact_events(&self) -> Result<ContactEventsView<'_>>
Borrow mapped contact events, fetching this native family at most once.
Sourcepub fn joint_events(&self) -> Result<JointEvents<'_>>
pub fn joint_events(&self) -> Result<JointEvents<'_>>
Borrow mapped joint events, fetching this native family at most once.
Sourcepub fn sensor_events(&self) -> Result<SensorEventsView<'_>>
pub fn sensor_events(&self) -> Result<SensorEventsView<'_>>
Borrow mapped sensor events, fetching this native family at most once.
Sourcepub fn to_owned(&self) -> Result<StepEventsSnapshot>
pub fn to_owned(&self) -> Result<StepEventsSnapshot>
Materialize every family and detach an owned snapshot from the world borrow.