Skip to main content

CompletedStep

Struct CompletedStep 

Source
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>

Source

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.

Source

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.

Source

pub fn body_events(&self) -> Result<BodyEvents<'_>>

Borrow mapped body-move events, fetching this native family at most once.

Source

pub fn contact_events(&self) -> Result<ContactEventsView<'_>>

Borrow mapped contact events, fetching this native family at most once.

Source

pub fn joint_events(&self) -> Result<JointEvents<'_>>

Borrow mapped joint events, fetching this native family at most once.

Source

pub fn sensor_events(&self) -> Result<SensorEventsView<'_>>

Borrow mapped sensor events, fetching this native family at most once.

Source

pub fn to_owned(&self) -> Result<StepEventsSnapshot>

Materialize every family and detach an owned snapshot from the world borrow.

Trait Implementations§

Source§

impl Debug for CompletedStep<'_>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CompletedStep<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'owner> !RefUnwindSafe for CompletedStep<'owner>

§

impl<'owner> !Send for CompletedStep<'owner>

§

impl<'owner> !Sync for CompletedStep<'owner>

§

impl<'owner> !UnwindSafe for CompletedStep<'owner>

§

impl<'owner> Freeze for CompletedStep<'owner>

§

impl<'owner> Unpin for CompletedStep<'owner>

§

impl<'owner> UnsafeUnpin for CompletedStep<'owner>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.